0
点赞
收藏
分享

微信扫一扫

JSP(14)_ JSP 动态标签_include 动态标签


本系列博客汇总在这里:JSP 汇总


目录

  • ​​JSP 动态标签​​
  • ​​include 动态标签​​

JSP 动态标签

include 动态标签

include 标签是动态包含,与 include 指令不同,include 标签与 RequestDispatcher.include() 方法的功能是相同的。

hel.jsp

​html <body> <% String name = request.getParameter("name"); System.out.print(name); %> <h1>name</h1> </body>​

lo.jsp

​html <body> <jsp:include page="/hel.jsp?name=weiyuxuan"></jsp:include> </body>​

动态包含是会为两个 JSP 页面都生成“真身”,然后 hel.jsp 的“真身”中会调用 lo.jsp 的“真身”的 _jspService() 方法而已。

JSP(14)_ JSP 动态标签_include 动态标签_页面传值

测试

JSP(14)_ JSP 动态标签_include 动态标签_JSP 动态标签_02

JSP(14)_ JSP 动态标签_include 动态标签_html_03

包含页面向被包含页面传值

JSP(14)_ JSP 动态标签_include 动态标签_html_04

如有错误,欢迎指正!



举报

相关推荐

0 条评论