练习jsp的include指令元素时出现的Multiple annotations found at this line: 错误

跟随老师练习指令元素时出现了
Multiple annotations found at this line:
- basePath cannot be resolved to a variable
- Line breakpoint:demo.jsp [line: 10]
的错误,是因为<%@include%>引进的是代码,把代码包含进来,而新进JSP时,会默认生成
**<%
String path = request.getContextPath();
String basePath = request.getScheme()+"?/"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

** 所以用<%@include%>引进页面是就报重复变量 basePath ,记录下来

版权声明:本文为qq_43499921原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。