首先确定问题应该是在action的namespace属性配置出了问题,因为不同result对应的资源文件是以这个namespace为前提的,所以,可以将namespace的值设置为“/”,表示当前项目的根目录,问题就解决了。
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<package name="test" namespace="/" extends="struts-default">
<action name="test" class="org.wei.web.action.TestAction">
<result name="success">/index.jsp</result>
</action>
</package>
</struts>
BY:http://blog.163.com/xiaohui_1123@126/blog/static/398052402011284153685/
分享到:
相关推荐
### Struts2框架中“No result defined for action and result input”错误解析及解决方法 #### 错误概述 在Struts2框架中开发Web应用程序时,可能会遇到一个名为“No result defined for action and result input...
在IT领域,尤其是在Web开发中,遇到“No result defined for action”这类错误是常见的问题,尤其当使用Struts2框架时更为突出。此类错误通常指向在控制器(Action)中未正确配置或实现结果集(Result),导致请求...
No result defined for action ***Action and result success **问题描述**: 当执行某个Action后,出现“没有定义success结果”的错误。 **解决方法**: 这意味着在`struts.xml`中未正确配置`success`结果。为了...
错误信息:“There is no result type defined for type 'json' mapped with name 'success'”。这意味着在`struts.xml`文件中没有正确定义JSON类型的处理结果。需要检查配置文件中的定义是否正确。 以上内容涵盖...
在提供的内容中提到了一个错误 `No result defined for action com.sxit.smxt.action.XXXAction and result input`。这意味着Struts2框架无法找到对应Action的`input`结果定义。 #### 解决方案: - **检查配置文件*...
Stops the action invocation immediately (by throwing a PauseException) and causes the action invocation to return the specified result, such as Action.SUCCESS, Action.INPUT, etc. void ...