错误提示为: Multiple annotations found at this line: - Duplicate local variable path - Duplicate local variable basePath 错误原因是:变量的重复定义 因为<%@include%>引进的是代码,把代码包含进来,而新进JSP时,会默认生成 <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %>
<base href="<%=basePath%>"> 这二句代码,所以用<%@include%>引进页面是就报重复变量 basePath
解决方法,把要引进页面这几句去掉就行, 也可重命名path和basePath变量,要不不引用path,直接用request.getContextPath();