當出現此錯誤時重複變量:
引入的jsp頁面會自動加入<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
和頁面中的變量重複,去掉引入頁面的此代碼就行。
引自:http://www.cnblogs.com/wangjing1982/p/3267979.html
錯誤提示:
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
解決方法,把要引進頁面這句去掉就行,