`
lycwhite
  • 浏览: 55926 次
  • 性别: Icon_minigender_1
  • 来自: 河南
社区版块
存档分类
最新评论

struts2 关于 No result defined for action and result success 的问题  

阅读更多

首先确定问题应该是在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/

分享到:
评论

相关推荐

    jsp\No result defined for action and result input.doc

    ### Struts2框架中“No result defined for action and result input”错误解析及解决方法 #### 错误概述 在Struts2框架中开发Web应用程序时,可能会遇到一个名为“No result defined for action and result input...

    No result defined for action.doc

    在IT领域,尤其是在Web开发中,遇到“No result defined for action”这类错误是常见的问题,尤其当使用Struts2框架时更为突出。此类错误通常指向在控制器(Action)中未正确配置或实现结果集(Result),导致请求...

    配置struts2常见错误

    No result defined for action ***Action and result success **问题描述**: 当执行某个Action后,出现“没有定义success结果”的错误。 **解决方法**: 这意味着在`struts.xml`中未正确配置`success`结果。为了...

    struts2错误集合.txt

    错误信息:“There is no result type defined for type 'json' mapped with name 'success'”。这意味着在`struts.xml`文件中没有正确定义JSON类型的处理结果。需要检查配置文件中的定义是否正确。 以上内容涵盖...

    我的JAVA开发工作笔记

    在提供的内容中提到了一个错误 `No result defined for action com.sxit.smxt.action.XXXAction and result input`。这意味着Struts2框架无法找到对应Action的`input`结果定义。 #### 解决方案: - **检查配置文件*...

    struts_2.3.12GA_API文档(chm版本)

    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 ...

Global site tag (gtag.js) - Google Analytics