posts - 325,  comments - 25,  trackbacks - 0
1.将以下三个常用struts tags 放到一个jsp页面下:
    tags.jsp
    <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%> 
    <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
    <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>

  2.bean标签
 <bean:cookie id="sess" name="JSESSIONID" value="JSESSIONID-IS-UNDEFINED"/>
将JSESSIONID的cookie定义为id为sess的bean
显示sess的comment属性:<bean:write name="sess" property="comment"/>
显示sess的maxAge属性:<bean:write name="sess" property="maxAge"/>
显示sess的path属性:<bean:write name="sess" property="path"/>
显示sess的secure属性:<bean:write name="sess" property="secure"/>
显示sess的value属性:<bean:write name="sess" property="value"/>
显示sess的version属性:<bean:write name="sess" property="version"/> 

<bean:define/>:
<bean:define id="bianliang name" value="bianliang value"/>  int i=0;
<bean:define id="variable1" name="variable2"/> //将variable2赋给variable1,同时定义了variable1
<bean:define id="variableName" name="beanName" property="beanProperty"/>将bean的property赋给variableName
<bean:define id="bean1" name="bean2" scope="scope1" toScope="scope2"/> 将scope1范围中的bean1转换到scope2范围中的bean2

<bean:header/>:
<bean:header id="variableName" name="headerName"/> 将headerName的请求头定义成variableName变量

<bean:parameter/>:
<bean:parameter id="variableName" name="parameter"/>将请求parameter的请求参数的值赋给variableName
url?b=xxx
<bean:parameter id="a" name="b"/>

<bean:include/>:
<bean:include id="beanName" path="uri"/>将uri对应的jsp资源赋给bean
posted on 2008-05-15 23:00 长春语林科技 阅读(739) 评论(0)  编辑  收藏 所属分类: struts

只有注册用户登录后才能发表评论。


网站导航:
 
<2008年5月>
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567

 

长春语林科技欢迎您!

常用链接

留言簿(6)

随笔分类

随笔档案

文章分类

文章档案

相册

收藏夹

搜索

  •  

最新评论

阅读排行榜

评论排行榜