struts FormBean的用处
来源:互联网 发布:matlab2013a mac下载 编辑:程序博客网 时间:2024/05/17 02:35
自己从页面中各个控件中搜集数据,放入Form中,以供其他页面
使用(要把该Form的作用域设置为session)
public final class HelloForm extends ActionForm {
private String userName = null;
public String getUserName() {
return (this.userName);
}
public void setUserName(String userName) {
this.userName = userName;
}
/**
* Reset all properties to their default values.
*/
public void reset(ActionMapping mapping, HttpServletRequest request) {
this.userName = null;
}
}
<action path = "/HelloWorld"
type = "hello.HelloAction"
name = "HelloForm"
scope = "session"
validate = "false"
input = "/view/test/hello.jsp"
>
<forward name="SayHello" path="/view/test/hello.jsp" />
</action>
页面可以通过以下方式获得:
<bean:define id="helloForm" name="HelloForm" toScope="session"/>
helloForm:<bean:write name="helloForm" /><br>
helloForm.userName:<bean:write name="helloForm" property="userName"/>
<br>
<br>
<logic:equal name="HelloForm" scope="session" property="userName" value="xiaoming">
xiaoming is a good boy!
</logic:equal>
<br>
<br>
<logic:empty name="HelloForm" scope="session" property="userName">
userName is empty!
</logic:empty>
- struts FormBean的用处
- struts formbean
- Struts 中 formbean的使用(小技巧)
- 带formbean的Struts工作过程
- struts的formbean的存活范围对程序的影响
- Struts的FormBean及常见错误和标签的使用
- Struts的FormBean及常见错误和标签的使用
- 使用Struts中的动态formbean时的注意事项
- struts formBean动态绑定数据的不足及改进
- (转)struts formBean动态绑定数据的不足及改进
- 传智播客struts学习,formbean属性的整数与日期类型
- struts中FormBean的reset和validate方法
- web开发:通用持久类代替hibernate的持久类、通用动态formBean类代替struts的formBean类
- 深入研究struts中的formbean
- Struts中FormBean内部验证
- struts学习笔记—FormBean
- HTML的表单元素与Struts的FormBean关联实验(以Struts的helloapp为例)
- 使用formbean的心得体会
- 八极拳的劲力
- vi 语法着色
- OpenCV里的模板匹配(转载)
- WEB程序员学习JS快速指南--概述
- webwork中的action如何取HttpServletRequest和HttpServletResponse对象
- struts FormBean的用处
- 蔡军生先生第二人生的源码分析(四十一)使用Apache运行库线程
- 关于Java多线程技术中所有方法的详细解析
- 蔡军生先生第二人生的源码分析(四十二)实现消息处理的线程类
- html控件透明与背景透明
- 蔡军生先生第二人生的源码分析(四十三)虚拟文件系统线程
- volatile的作用
- 常用数据库的链接方法
- P6Spy源码分析,理解跟踪SQL的工作原理