test1.jsp

<%
    int a = 5;
    out.println(a);
%>

test2.jsp

<jsp:include page="/test1.jsp"/>
<%
    int a = 10;
    out.println(a);
%>

test2.jsp中使用include标签引用了test1.jsp,但是能够正常编译通过,因为include标签经过了处理
test3.jsp

<%
    int a = 15;
    System.out.println(a);
%>
%@include file="test1.jsp"%

使用了@include指令,会将文件直接放到此处不经过处理,因此出现错误,重复定义变量。

相关文章:

  • 2022-12-23
  • 2021-10-17
  • 2021-07-03
  • 2022-12-23
  • 2022-02-04
  • 2021-10-18
  • 2022-12-23
  • 2021-09-17
猜你喜欢
  • 2021-12-07
  • 2021-08-28
  • 2022-12-23
  • 2022-12-23
  • 2022-03-03
  • 2021-09-09
相关资源
相似解决方案