错误提示:
因为<%@include%>引进的是代码,把代码包含进来,而新进JSP时,会默认生成
<% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <base href="<%=basePath%>">
这二句代码,所以用<%@include%>引进页面是就报重复变量 basePath
解决方法,把要引进页面这句去掉就行,
建议页面无逻辑代码可用<jsp:include/>这个引入的是结果,就是引进页面编译后的结果,适用于纯html页面
本文标题:JSP 使用静态引入时报Duplicate local variable path 错误 解决方法
本文链接:https://dingqidong.com/?id=147
版权声明:本文使用「署名-非商业性使用-相同方式共享 4.0 国际」创作共享协议,转载或使用请遵守署名协议。
评论