博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
JSP include directive 和JSP include的区别
阅读量:7123 次
发布时间:2019-06-28

本文共 1538 字,大约阅读时间需要 5 分钟。

hot3.png

Difference between JSP include directive and JSP include action

  • <%@ include file=”filename” %> is the JSP include directive.
    At JSP page translation time, the content of the file given in the include directive is ‘pasted’ as it is, in the place where the JSP include directive is used. Then the source JSP page is converted into a java servlet class. The included file can be a static resource or a JSP page. Generally JSP include directive is used to include header banners and footers.

    The JSP compilation procedure is that, the source JSP page gets compiled only if that page has changed. If there is a change in the included JSP file, the source JSP file will not be compiled and therefore the modification will not get reflected in the output.

  • <jsp:include page=”relativeURL” /> is the JSP include action element.
    The jsp:include action element is like a function call. At runtime, the included file will be ‘executed’ and the result content will be included with the soure JSP page. When the included JSP page is called, both the request and response objects are passed as parameters.

    If there is a need to pass additional parameters, then jsp:param element can be used. If the resource is static, its content is inserted into the calling JSP file, since there is no processing needed.

  • 所以用<jsp:include page="${actionjs}" />可以动态指定要包含的file,因为这个动作元素可以是在执行jsp文件生成的class可编译文件的时候才去找page属性相关的那个文件。

  •  而用<jsp:directive.include file="/js/erp/hr/genericReport/GenericReportAction.js" />只能写死包含的文件。

转载于:https://my.oschina.net/u/1583086/blog/405811

你可能感兴趣的文章
上传绕过WAF几种常见的姿势
查看>>
Cocos2d-x3.0RC2 EditBox
查看>>
常用PHP MySQL函数
查看>>
利用Excel导入数据到SAP C4C
查看>>
Restful API 设计(二)
查看>>
【响应式布局】initial containing block、viewport以及相关尺寸
查看>>
ajax在同一页面中同控制器不同方法中调用数据并异步刷新的实例
查看>>
代码性能调优“三十六”策
查看>>
面向云数据库,超低延迟文件系统PolarFS诞生了
查看>>
redis学习一, 在mac系统下安装
查看>>
Matrix 矩阵css3
查看>>
CSS世界(文档)
查看>>
【跃迁之路】【515天】程序员高效学习方法论探索系列(实验阶段272-2018.07.05)...
查看>>
【Arduino基础教程】RS1307时钟模块
查看>>
win10电脑桌面便签怎么固定在桌面?
查看>>
[Spring] Web层AOP方式进行参数校验
查看>>
虚函数表
查看>>
shiro实战系列(十四)之配置
查看>>
储能型数据中心对UPS电池的发展要求
查看>>
《Kotlin极简教程》第2章 快速开始:HelloWorld
查看>>