1、struts2一直无法获得jsp传值,原来是extends写成了abstract

万马奔腾。。。
2、用户登陆成功后Action跳转页面Could not find action or result
<action name="user_*" class="com.awf.crm.web.action.UserAction" method="{1}">
<result name="REGIST">/regist.jsp</result>
<result name="SUCCESS">/index.jsp</result>
</action>
改为
<action name="user_*" class="com.awf.crm.web.action.UserAction" method="{1}">
<result name="regist">/regist.jsp</result>
<result name="success">/index.jsp</result>
</action>
就可以成功跳转了
草泥马,居然是大小写的问题,难道 result只认小写?
3、jsp提交带下拉空间的页面提示object references an unsaved transient instance - save the transient instance before flushing
22:20:35.150 [http-nio-8080-exec-6] ERROR org.hibernate.internal.SessionImpl - HHH000346:
Error during managed flush [object references an unsaved transient instance - save the
transient instance before flushing: com.awf.crm.domain.BaseDict]
这是因为下拉数据设计数据字典,存在一对多的对象映射配置,在Action中只保存了Customer信息,没有保存basedict对象导致。
博客讲述了在使用Struts2时遇到的两个常见问题及解决办法。首先,由于将`extends`误写为`abstract`导致无法从JSP获取值。其次,用户登录后Action跳转页面失败,原因是URL大小写不敏感导致的找不到action或result。最后,解决了一个关于jsp提交时因未保存相关对象引发的错误。
142

被折叠的 条评论
为什么被折叠?



