最进有点时间,学习下struts2,版本是2.0.14
参照这位老兄的博客http://www.blogjava.net/max/category/16130.html,学习
遇到
According to TLD or attribute directive in tag file, attribute value does not accept any expressions
查看半天,原来是从2.0.11版本器,struts不再支持struts标签、jetl混用了
设置includ页面参数只能使用
<s:param name="ParamName">ParamNameValue</s:param>
includ页面获取参数,只能使用${param.ParamName}
参见:http://struts.apache.org/2.0.14/docs/include.html
struts2 could not be resolved as a collection/array/map/enumeration/iterator type
直接访问jsp页面时,容易出面上面情况,原因是action没有初始化。
通过action来访问jsp
http://localhost:8080/struts2/example/UITagExample.action
Could not create and/or set value back on to object
struts 表单使用POJO访问时,容易遇到上述错误
form片段如下
<s:form action="LoginX" method="POST">
<s:textfield name="user.name" label="User name"/>
<s:password name="user.password" label="Password"/>
<s:submit value="Submit"/>
</s:form>
action片段
private User user;
原因是user在action中还没有初始化,
解决:
1、在user类中添加无参数的构造方法,public User() {}
2、在action类中,初始化user private User user = new User("","");
分享到:
相关推荐
strut2 登录strut2 登录strut2 登录
strut2jar包
strut2入门教程,是初学者比较好的参考文档
strut2需要的jar包,共有5个jar文件。strut2需要的jar包,共有5个jar文件。
该代码使用strut+hibernate,是一个完整的登录代码。登录逻辑是:从数据库表读取里面存有的用户名和密码,用户在tomcat运行的登录界面上输入用户名和密码,如果输入正确,则进入成功界面,失败则重置登录界面密码,...
strut2 spring hibernate web 相关配置文件strut2 spring hibernate web 相关配置文件strut2 spring hibernate web 相关配置文件strut2 spring hibernate web 相关配置文件strut2 spring hibernate web 相关配置文件
DWR 入门DWR 入门DWR 入门DWR 入门DWR 入门欢迎使用 STRUT2 DWR 入门STRUT2 DWR 入门STRUT2 DWR 入门STRUT2 DWR 入门
strut2.3.4,json,jquery简单登录实例,对于学习strut ajax有一定的帮助
strut2 hibernate spring 整合 Jar包
strut2标签使用strut2标签使用strut2标签使用strut2标签使用strut2标签使用strut2标签使用
strut2框架关于验证的使用方法
自己看 主要是关于strut和strut2的 没有学过的要多注意细节
strut2简单登录功能实现,作为学习Struts2的资源,共享。
strut2使用cookie实现自动登录,其中用到了过滤器来实现自动登录
传智播客_黎活明_strut2的视频PPT
strut2的拦截器的例子希望对初学者有所帮助
使用tomcat v5.0 eclipse3.7 jdk1.5实现strut1的用户简易登陆
struts2.3开发包
strut2学习的教程,是很不错的,大家看看
strut2文件上传实例strut2文件上传实例strut2文件上传实例strut2文件上传实例strut2文件上传实例strut2文件上传实例