JSP行为是一组JSP内置标签,jsp行为是对常用jsp功能的抽象与封装。(自定义jsp行为和标准jsp行为)标准jsp行为格式:
1 <jsp:elements {attribute="value"}* />
include行为
1 | <jsp:include page="relativeURL" flush="true" /> |
flush属性:设置读入被保存文件内容前是否清空缓存,默认为false
javabean 行为
包括useBean、setProperty、getProperty
useBean
1 | <jsp:useBean id="beanID" class="className" scope="value" /> |
- id 引用javabean对象
- class 全类名
- scope javabean使用范围
setProperty
1 | <jsp:setProperty name="beanName" property="propertyName" value="" /> |
getProperty
1 | <jsp:getProperty name="beanName" property="propertyName" /> |
jstl 是一套标准jsp行为
plugin行为
1 | <jsp:plugin /> //定义java applet |
forword 行为
1 | <jsp:forword page="relativeURL"> |
directive 行为
1 | <jsp:directive.page> //<%@ page%> |