myeclipse在有jsp中自带的全局声明的时候,静态引入jsp的时候报错

在myeclipse里面新建一个工程后新建b.jsp和a.jsp放在工程的webroot目录下,
在b.jsp的标签上面有jsp中自带的全局路径声明:

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

在有jsp自带的全局路径声明的情况下,在

中静态引入jsp的时候就会报错,
  <%@include file="a.jsp" %>

错误信息如下:

Multiple annotations found at this line:
    - Duplicate local variable path
    - Duplicate local variable 

中文翻译如下:

这一行有多个注释:

-复制本地变量路径

-复制局部变量

可以确认file的相对路径是对的,因为a.jsp和b.jsp在同一个文件夹下。
另外在删掉jsp中自带的全局声明的时候下面的静态引入就不报错了。

https://blog.csdn.net/qq_41593844/article/details/80215387

可以使用 jsp: include file="a.jsp"/>动态引入,如果使用静态引入会默认生成<%String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>,存在变量名重复问题