【struts标签】
bean:define
定义变量赋值有三种方式:
1。设置value属性,此时id属性定义的变量为字符串,value属性代表这个变量的字符串值。
<bean:defind id="userName" value="jing" />
UserName: <bean:write name="userName"/>
2。同时设置name和property属性。name属性指定一个已经存在的Bean。
Property属性指定已经存在的Bean的某个属性。id属性定义的变量的值由property属性决定。
<%request.setAttribute("sessionBean",session);%>
<bean:defind id="theSession" name="sessionBean" property="servletContext"/>
ServletContext Name: <bean:write name="theSession" property="servletContextName"/>
3。同时设置name和type属性。
<bean:defind id="loginBean" name="loginBean" type="com.jason.action.LoginBean"/>
<bean:write name="loginBean" property="password"/>
bean:size
用于获得Map,Collection的长度,id指定一个Integer类型的变量,name指定已经存在的map,collection或者数组。
<%
HashMap lines = new HashMap();
lines.put("1","Line 1");
lines.put("2","Line 2");
lines.put("3","Line 3");
request.setAttribute("lines",lines);
%>
<bean:size id="length" name="lines"/>
<bean:write name="length"/>
---------------摘自http://www.blogjava.net/gm_jing/articles/60004.html
相关推荐
struts标签 • Bean Tags:该标签库包含的标签可以用来创建bean、访问bean和访问bean的属性。同时提供了依据cookies、headers和parameters的值创建相关bean的能力。 HTML Tags:该标签库包含的标签可以用来创建...
struts标签库struts标签库struts标签库struts标签库struts标签库struts标签库struts标签库struts标签库
Struts2标签库Struts2标签库Struts2标签库Struts2标签库Struts2标签库Struts2标签库
struts1标签struts1标签struts1标签struts1标签struts1标签struts1标签struts1标签struts1标签struts1标签struts1标签struts1标签struts1标签struts1标签struts1标签struts1标签struts1标签struts1标签
struts2标签库struts2标签库struts2标签库struts2标签库
Struts标签 Struts标签Struts标签Struts标签Struts标签
Struts 标签 页面跳转 数据库操作 Struts 标签 页面跳转 数据库操作 Struts 标签 页面跳转 数据库操作
Struts标签 大全
Struts标签库Struts标签库Struts标签库案例
struts标签中文手册,struts标签中文手册,struts标签中文手册
第5章_Struts标签库.ppt第5章_Struts标签库.ppt
struts标签库里面包括struts所有的标签使用源码
Struts提供了五个标签库,即:HTML、Bean、Logic、Template和Nested。 HTML 标签 : 用来创建能够和Struts 框架和其他相应的HTML 标签交互的HTML 输入表单 ...Nested标签: 增强对其他的Struts 标签的嵌套使用的能力
Struts标签 和jstl标签Struts标签 和jstl标签
常用jstl和struts标签标签的用法
struts标签中文文档 下载附件后把taglib1.war放在tomcat的webapps下,(或用其他应用服务器) 然后启动tomcat服务 在浏览器中输入http://localhost:8080/taglib1即可
Struts标签参考 struts标签手册
struts2标签使用例子 struts2标签使用例子 struts2标签使用例子struts2标签使用例子
Struts标签大全.doc版,写的不错
一些常用的struts标签 在常用的开发当中基本够用了~~