论坛首页 Java企业应用论坛

webwork中的一个奇怪现象!

浏览 4907 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (9)
作者 正文
   发表时间:2007-07-23  
我的框架是webwork+spring+hibernate  .有一个很奇怪现象,就是我在页面提交了一个数据类型和pojo的类型不相同的类型,肯定会出错.但是问题是一出错就,就整个类里面的所有方法都出错了,而且非得重启tomcat 才能用回这个类里面的方法.比如:一个联系ID是number型,我输入了string型.提交出错是预料中事,出错后,我再点会这个页面,也会跳到错误页面,不知大家是否有遇到这种情况?这是什么问题呢?错误后那些代码提示是没有找到这个方法了..
我把错误代码贴出来.
[DEBUG] 2007-07-17 16:01:13 com.opensymphony.xwork.util.XWorkConverter - Class: com.sztelecom.csc.mcms.action.schedule.ScheduleAction
[DEBUG] 2007-07-17 16:01:13 com.opensymphony.xwork.validator.ValidationInterceptor - Validating /jsp/schedule/insertSchedule with method insertSchedule.
[DEBUG] 2007-07-17 16:01:13 com.opensymphony.xwork.interceptor.DefaultWorkflowInterceptor - Invoking validate() on action com.sztelecom.csc.mcms.action.schedule.ScheduleAction@eb1ba3
[DEBUG] 2007-07-17 16:01:14 com.opensymphony.xwork.interceptor.PrefixMethodInvocationUtil - cannot find method [validateInsertSchedule] in action [com.sztelecom.csc.mcms.action.schedule.ScheduleAction@eb1ba3]
[DEBUG] 2007-07-17 16:01:14 com.opensymphony.xwork.interceptor.PrefixMethodInvocationUtil - cannot find method [validateDoInsertSchedule] in action [com.sztelecom.csc.mcms.action.schedule.ScheduleAction@eb1ba3]
[DEBUG] 2007-07-17 16:01:14 com.opensymphony.xwork.interceptor.DefaultWorkflowInterceptor - Errors on action com.sztelecom.csc.mcms.action.schedule.ScheduleAction@eb1ba3, returning result name 'input'
[WARN ] 2007-07-17 16:01:14 com.opensymphony.xwork.DefaultActionInvocation - No result defined for action com.sztelecom.csc.mcms.action.schedule.ScheduleAction and result input
[DEBUG] 2007-07-17 16:01:14 com.opensymphony.xwork.interceptor.I18nInterceptor - after Locale=zh_CN
[DEBUG] 2007-07-17 16:01:14 com.opensymphony.xwork.interceptor.I18nInterceptor - intercept }  

上面有一段是说cannot find method .这个就奇怪了,本来这个方法是好好的.出错就永回不来了.
   发表时间:2007-07-24  
难到没人遇到过?我想会不会是webwork的自动转换类型惹的祸?那为什么转换失败后就永运出错呢?
0 请登录后投票
   发表时间:2007-08-03  
这个问题我也遇到过,只是我用的是RESIN,只有关掉它,然后再重开。
0 请登录后投票
   发表时间:2007-08-03  
我的解决方法是
第一种方法
在 JavaScript 中做验证,然后再去提交 action

第二种方法就是:要不你就用 POJO 类  可以再也一个VO 类
然后 在 validate 中做验证
0 请登录后投票
   发表时间:2008-05-17  
加上validation
0 请登录后投票
   发表时间:2008-05-18  
你的webwork的实例是不是由spring注入的,我用的是struts2,用spring注入的时候会出现和你类似的问题
然后取消注入就行了,
0 请登录后投票
   发表时间:2008-07-09  
yewenyu 写道
我的框架是webwork+spring+hibernate  .有一个很奇怪现象,就是我在页面提交了一个数据类型和pojo的类型不相同的类型,肯定会出错.但是问题是一出错就,就整个类里面的所有方法都出错了,而且非得重启tomcat 才能用回这个类里面的方法.比如:一个联系ID是number型,我输入了string型.提交出错是预料中事,出错后,我再点会这个页面,也会跳到错误页面,不知大家是否有遇到这种情况?这是什么问题呢?错误后那些代码提示是没有找到这个方法了..
我把错误代码贴出来.
[DEBUG] 2007-07-17 16:01:13 com.opensymphony.xwork.util.XWorkConverter - Class: com.sztelecom.csc.mcms.action.schedule.ScheduleAction
[DEBUG] 2007-07-17 16:01:13 com.opensymphony.xwork.validator.ValidationInterceptor - Validating /jsp/schedule/insertSchedule with method insertSchedule.
[DEBUG] 2007-07-17 16:01:13 com.opensymphony.xwork.interceptor.DefaultWorkflowInterceptor - Invoking validate() on action com.sztelecom.csc.mcms.action.schedule.ScheduleAction@eb1ba3
[DEBUG] 2007-07-17 16:01:14 com.opensymphony.xwork.interceptor.PrefixMethodInvocationUtil - cannot find method [validateInsertSchedule] in action [com.sztelecom.csc.mcms.action.schedule.ScheduleAction@eb1ba3]
[DEBUG] 2007-07-17 16:01:14 com.opensymphony.xwork.interceptor.PrefixMethodInvocationUtil - cannot find method [validateDoInsertSchedule] in action [com.sztelecom.csc.mcms.action.schedule.ScheduleAction@eb1ba3]
[DEBUG] 2007-07-17 16:01:14 com.opensymphony.xwork.interceptor.DefaultWorkflowInterceptor - Errors on action com.sztelecom.csc.mcms.action.schedule.ScheduleAction@eb1ba3, returning result name 'input'
[WARN ] 2007-07-17 16:01:14 com.opensymphony.xwork.DefaultActionInvocation - No result defined for action com.sztelecom.csc.mcms.action.schedule.ScheduleAction and result input
[DEBUG] 2007-07-17 16:01:14 com.opensymphony.xwork.interceptor.I18nInterceptor - after Locale=zh_CN
[DEBUG] 2007-07-17 16:01:14 com.opensymphony.xwork.interceptor.I18nInterceptor - intercept }  

上面有一段是说cannot find method .这个就奇怪了,本来这个方法是好好的.出错就永回不来了.


突然想到了,你这个问题可能是action被设置成单例模式造成的
0 请登录后投票
   发表时间:2008-07-21  
你遇到的问题,早段时间我也遇到过,也在javaeye发帖了,可惜被管理员们设置为了隐藏贴
我一直怀疑是 三个框架版本的兼容性问题 .............
期待高手的指定......
0 请登录后投票
   发表时间:2008-07-22  
spring中bean标签的scope属性设为prototype
1 请登录后投票
论坛首页 Java企业应用版

跳转论坛:
Global site tag (gtag.js) - Google Analytics