No result defined for action com.niit.ssh2.action.BookAction and result success
来源:互联网 发布:js animate transform 编辑:程序博客网 时间:2024/05/16 16:17
先前是因为
<result>/ProductBase.jsp</result>
<result name="ERROR">/ProductBase.jsp</result>
</action>
struts2异常java.lang.NoSuchMethodException: com.struts.action.UserAction.create()这个异常造成的。可是我的方法什么的都有。只是先前把acation的类名写错了。写成另一个action类了。改过以后还出这个错。重启服务器。过了好一会才反应过来。是我电脑本身的原因吧。
在后面又出现一个错误。No result defined for action com.niit.ssh2.action.BookAction and result succ
这是我的控制台信息:写给大家看的项目管理书-第2版***Gregory M.Horine
2013-06-20 23:02:13,771 ERROR [org.apache.struts2.dispatcher.Dispatcher] - Could not find action or result
/ssh2_wl/findBookById?id=3
No result defined for action com.niit.ssh2.action.BookAction and result success
2013-06-20 23:02:13,771 ERROR [org.apache.struts2.dispatcher.Dispatcher] - Could not find action or result
/ssh2_wl/findBookById?id=3
No result defined for action com.niit.ssh2.action.BookAction and result success
我在网上搜了好久,那些方法都对我没用。我后面想想,我控制台已经进入哪个action方法了。这是控制台输出的信息。已经能找到了。我又在struts里配置了一个error的返回。这是action的方法
public String findBookById() throws Exception {
book = bookService.findBookById(id);
System.out.println(book.getTitle()+"***"+book.getAuthor());
if(book!=null){
return SUCCESS;
}else{
return ERROR;
}
book = bookService.findBookById(id);
System.out.println(book.getTitle()+"***"+book.getAuthor());
if(book!=null){
return SUCCESS;
}else{
return ERROR;
}
这是struts的配置:
<action name="findBookById" class="com.niit.ssh2.action.BookAction" method="findBookById">
<result name="SUCCESS">/ProductBase.jsp</result>
<result name="ERROR">/ProductBase.jsp</result>
</action>这样的配置还出错。
<result name="SUCCESS">/ProductBase.jsp</result>
<result name="ERROR">/ProductBase.jsp</result>
</action>这样的配置还出错。
换成这样才对了:
<action name="findBookById" class="com.niit.ssh2.action.BookAction" method="findBookById"><result>/ProductBase.jsp</result>
<result name="ERROR">/ProductBase.jsp</result>
</action>
这样也是对的:
<action name="findBookById" class="com.niit.ssh2.action.BookAction" method="findBookById">
<result>/ProductBase.jsp</result>
</action>
<result>/ProductBase.jsp</result>
</action>
不知道什么原因。贴上来给大家参考一下。
- No result defined for action com.niit.ssh2.action.BookAction and result success
- No result defined for action action.LoginAction and result success
- No result defined for action action.LoginAction and result success
- No result defined for action Action.calculation and result success
- No result defined for action action.LoginAction and result success
- action莫名报错 No result defined for action com.action.Logout and result success
- No result defined for action com.weiyi.bbs.action.LoginAction and result success总结
- HTTP Status 404 - No result defined for action com.lnzkx.action.PeronAction and result success
- No result defined for action com.stickon.action.loginAction and result success
- HTTP Status 404 - No result defined for action com.ssk.action.Register and result success
- No result defined for action com.ys.action.ModuleAction and result success
- No result defined for action com.test.action.GeneratorAction and result success
- No result defined for action com.standard.action.LoginAction and result success
- 错误日志No result defined for action com.action.LoginAction and result success.
- No result defined for action com.action.ratingAction and result success 原因
- HTTP Status 404 - No result defined for action com.tencent.action.UserAction and result success
- No result defined for action com.frank.action.RegistAction and result success
- No result defined for action com.xiao.action.Haha and result success
- ubuntu10.10 tftp安装,配置,测试
- 晶体管基础知识
- 在android中使用junit
- Adobe Dreamweaver CS6 破解
- 关于Hadoop 的配置信息
- No result defined for action com.niit.ssh2.action.BookAction and result success
- [031] 微信公众帐号开发教程第7篇-文本消息中换行符的使用
- 总结:复合数据对象
- Cookie和session解析
- 用CWnd类的函数MoveWindow()或SetWindowPos()可以改变控件的大小和位置
- 关于手势(Gesture)
- 对于linux下system()函数的深度理解(整理)
- different user control type: reuse layout vs reuse data
- 在android中使用junit(2)