JSP出现Duplicate local variable path报错

Jy_wjz 2019-03-21 11:27:26
Multiple annotations found at this line:

 - Duplicate local variable path

 - Duplicate local variable 

  basePath

其实就是说明你要加载的文件中含有重复变量,这是因为在myeclipse中创建另一个需要链接的Jsp文件

编译器会自动生成下面梁行代码。

<%

String path = request.getContextPath();

String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

%>

 

处理方法:

将错误提示里的jsp文件里的这两行代码删除掉即可。
...全文
382 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
bcsflilong 2019-03-21
  • 打赏
  • 举报
回复
谢谢分享

58,454

社区成员

发帖
与我相关
我的任务
社区描述
Java Eclipse
社区管理员
  • Eclipse
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧