Struts2 报 No result defined for action异常

4657 2013-10-30 10:54:00
求大神帮我看看是不是配置哪里错了

No result defined for action manager.com.of.action.of.framelist.DeptsAction and result list


<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>

<!-- =================开发模式开始====================== -->
<!-- 开发状态 -->
<constant name="struts.devMode" value="true" />
<!-- 国际化资源重新加载 -->
<constant name="struts.i18n.reload" value="true" />
<!-- 配置文件重新加载 -->
<constant name="struts.configuration.xml.reload" value="true" />
<!-- convention类从新加载 -->
<constant name="struts.convention.classes.reload" value="true" />

<!-- =================开发模式结束====================== -->


<!-- 上次文件大小限制-->
<constant name="struts.multipart.maxSize" value="10002097152" />
<!-- 主题 -->
<constant name="struts.ui.theme" value="simple" />
<!-- 地区 -->
<constant name="struts.locale" value="zh_CN" />
<!-- 国际化编码 -->
<constant name="struts.i18n.encoding" value="UTF-8" />
<!-- 扩展-->
<constant name="struts.action.extension" value="action,do," />
<!-- 启用动态方法调用 -->
<constant name="struts.enable.DynamicMethodInvocation" value="true" />
<!-- 设置Struts 2是否允许在Action名中使用斜线 -->
<constant name="struts.enable.SlashesInActionNames" value="false" />
<!-- 结果资源所在路径 -->
<constant name="struts.convention.result.path" value="/WEB-INF/page/" />
<!-- action后缀 -->
<constant name="struts.convention.action.suffix" value="Action" />
<!-- 名称首字母小写 -->
<constant name="struts.convention.action.name.lowercase" value="true" />
<!-- 分隔符 一个action名字的获取。比如为HelloWorldAction。按照配置,actionName为hello_world。-->
<constant name="struts.convention.action.name.separator" value="_" />
<!-- 禁用扫描 -->
<constant name="struts.convention.action.disableScanning" value="false" />
<!-- 默认包 -->
<constant name="struts.convention.default.parent.package" value="default" />
<!--确定搜索包的路径 -->
<constant name="struts.convention.package.locators" value="action,framelist" />
<!-- 禁用包搜索 -->
<constant name="struts.convention.package.locators.disable" value="false" />
<!--
如果此值设为true,如果一个action的命名空间为/login,名称为HelloWorldAction。result返回值
是success,默认会找到/WEB-INF/pages/login/hello_world.jsp(如果有hello_world_success.jsp就找这个文件,连接符“_”是在<constant
name="struts.convention.action.name.separator"
value="_"/>中配置的)。如果有一个action的result返回值是“error”,就会找/WEB-INF/pages
/login/hello_world_error.jsp。

如果此值设为false,如果一个action的命名空间为/login,名称为HelloWorldAction。result返回值是
success,默认会找到/WEB-
INF/pages/login/hello_world/index.jsp(如果有success.jsp就找这个文件)。如果有一个action的
result返回值是“error”,就会找/WEB-INF/pages /login/hello_world/error.jsp。
-->
<constant name="struts.convention.result.flatLayout" value="true"/>
<!-- 设置即使没有@Action注释,依然创建Action映射。默认值是false -->
<constant name="struts.convention.action.mapAllMatches" value="false"/>
<!-- 设置是否实现了Action接口的类映射成Action。默认值是ture -->
<constant name="struts.convention.action.checkImplementsAction" value="true"/>
<!--
设置是否重定向到斜线(/)。例如用户请求/foo,但/foo不存在时,如果设置该常量为则可重定向到/foo/。默认值是true
-->
<constant name="struts.convention.redirect.to.slash" value="true" />
<constant name="struts.mapper.alwaysSelectFullNamespace" value="false" />


<!-- =================struts2与spring整合的配置开始=================== -->

<!-- 指定Struts 2默认的ObjectFactory Bean,该属性默认值是spring -->
<constant name="struts.objectFactory" value="spring" />

<!--
该属性指定整合Spring框架时,是否缓存Bean实例,该属性只允许使用true和false两个属性值,它的默认值是true。通常不建议修改该属性值
-->
<constant name="struts.objectFactory.spring.useClassCache" value="true" />


<!--
指定spring框架的装配模式装配方式有: name, type, auto, and constructor (name 是默认装配模式)
-->
<constant name="struts.objectFactory.spring.autoWire" value="name"></constant>


<!-- =================struts2与spring整合的配置结束=================== -->

<package name="default" extends="struts-default">
<interceptors>
<interceptor-stack name="myStack">
<interceptor-ref name="defaultStack"></interceptor-ref>
<interceptor-ref name="actionStack"></interceptor-ref>
</interceptor-stack>
<interceptor name="actionStack" class="manager.com.of.util.ActionInterceptor" />
</interceptors>
<default-interceptor-ref name="myStack" />

<!-- 重定义全局result -->
<global-results>
<result name="message">/WEB-INF/page/of/message.jsp</result>
<result name="index">/WEB-INF/page/of/index.html</result>
<result name="unLogin">/WEB-INF/page/of/unlogin.jsp</result>
</global-results>
</package>



</struts>
...全文
147 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
失落夏天 2013-10-30
  • 打赏
  • 举报
回复
引用 4 楼 u012612581 的回复:
[quote=引用 1 楼 AA5279AA 的回复:] <global-results> <result name="message">/WEB-INF/page/of/message.jsp</result> <result name="index">/WEB-INF/page/of/index.html</result> <result name="unLogin">/WEB-INF/page/of/unlogin.jsp</result> </global-results> </package> </struts> 这里,少了一个error的 <result name="error">/WEB-INF/page/of/error.jsp</result>
跟这个好像没有关系,我也试了,不行[/quote] No result defined for action 这个貌似只能理解为你result定义的不够,你返回的结果是什么? 另外每次运行工程的时候,一定要clean一下,然后重新部署,最好清除一下缓存
4657 2013-10-30
  • 打赏
  • 举报
回复
引用 1 楼 AA5279AA 的回复:
<global-results> <result name="message">/WEB-INF/page/of/message.jsp</result> <result name="index">/WEB-INF/page/of/index.html</result> <result name="unLogin">/WEB-INF/page/of/unlogin.jsp</result> </global-results> </package> </struts> 这里,少了一个error的 <result name="error">/WEB-INF/page/of/error.jsp</result>
跟这个好像没有关系,我也试了,不行
4657 2013-10-30
  • 打赏
  • 举报
回复
引用 2 楼 rui888 的回复:
这个 DeptsAction 对应的 result 没有把。
程序可以跑到后台,就是跑不到页面
tony4geek 2013-10-30
  • 打赏
  • 举报
回复
这个 DeptsAction 对应的 result 没有把。
失落夏天 2013-10-30
  • 打赏
  • 举报
回复
<global-results> <result name="message">/WEB-INF/page/of/message.jsp</result> <result name="index">/WEB-INF/page/of/index.html</result> <result name="unLogin">/WEB-INF/page/of/unlogin.jsp</result> </global-results> </package> </struts> 这里,少了一个error的 <result name="error">/WEB-INF/page/of/error.jsp</result>
脱轨的码农996 2013-10-30
  • 打赏
  • 举报
回复
把<constant name="struts.convention.package.locators" value="action,framelist" /> 改成 value="action",因为你的framelist是在action包里,所以它扫描action也会找到的。还有页面跳转的路径要写正切,要加上“/framelist/",把缓存清空再打开试试
  • 打赏
  • 举报
回复
没有list这个result。。。在struts.xml中配上name为list的result就行了。。。
beckhamcat1 2013-10-30
  • 打赏
  • 举报
回复
在程序打断点,跟一遍看看return的是什么
-------------------------------------------------------------------------------- 概述 软件包 类 使用 树 已过时 索引 帮助 上一个类 下一个类 框架 无框架 所有类 摘要: 嵌套 | 字段 | 构造方法 | 方法 详细信息: 字段 | 构造方法 | 方法 -------------------------------------------------------------------------------- com.opensymphony.xwork2 类 ActionSupport java.lang.Object 继承者 com.opensymphony.xwork2.ActionSupport 所有已实现的接口: Action, LocaleProvider, TextProvider, Validateable, ValidationAware, Serializable 直接已知子类: DefaultActionSupport -------------------------------------------------------------------------------- public class ActionSupportextends Objectimplements Action, Validateable, ValidationAware, TextProvider, LocaleProvider, SerializableProvides a default implementation for the most common actions. See the documentation for all the interfaces this class implements for more detailed information. 另请参见: 序列化表格 -------------------------------------------------------------------------------- 字段摘要 从接口 com.opensymphony.xwork2.Action 继承的字段 ERROR, INPUT, LOGIN, NONE, SUCCESS 构造方法摘要 ActionSupport() 方法摘要 void addActionError(String anErrorMessage) Add an Action-level error message to this Action. void addActionMessage(String aMessage) Add an Action-level message to this Action. void addFieldError(String fieldName, String errorMessage) Add an error message for a given field. void clearActionErrors() Clears action errors. void clearErrors() Clears all errors. void clearErrorsAndMessages() Clears all errors and messages. void clearFieldErrors() Clears field errors. void clearMessages() Clears messages. Object clone() String doDefault() String execute() A default implementation that does nothing an returns "success". Collection getActionErrors() Get the Collection of Action-level error messages for this action. Collection getActionMessages() Get the Collection of Action-level messages for this action. Collection getErrorMessages() 已过时。 Use getActionErrors(). Map> getErrors() 已过时。 Use getFieldErrors(). Map> getFieldErrors() Get the field specific errors associated with this action. String getFormatted(String key, String expr) Dedicated method to support I10N and conversion errors Locale getLocale() Gets the provided locale. String getText(String aTextName) Gets a message based on a message key, or null if no message is found. String getText(String aTextName, List<?> args) Gets a message based on a key using the supplied args, as defined in MessageFormat, or null if no message is found. String getText(String aTextName, String defaultValue) Gets a message based on a key, or, if the message is not found, a supplied default value is returned. String getText(String key, String[] args) Gets a message based on a key using the supplied args, as defined in MessageFormat, or null if no message is found. String getText(String aTextName, String defaultValue, List<?> args) Gets a message based on a key using the supplied args, as defined in MessageFormat, or, if the message is not found, a supplied default value is returned. String getText(String key, String defaultValue, List<?> args, ValueStack stack) Gets a message based on a key using the supplied args, as defined in MessageFormat, or, if the message is not found, a supplied default value is returned. String getText(String aTextName, String defaultValue, String obj) Gets a message based on a key using the supplied obj, as defined in MessageFormat, or, if the message is not found, a supplied default value is returned. String getText(String key, String defaultValue, String[] args) Gets a message based on a key using the supplied args, as defined in MessageFormat, or, if the message is not found, a supplied default value is returned. String getText(String key, String defaultValue, String[] args, ValueStack stack) Gets a message based on a key using the supplied args, as defined in MessageFormat, or, if the message is not found, a supplied default value is returned. ResourceBundle getTexts() Get the resource bundle associated with the implementing class (usually an action). ResourceBundle getTexts(String aBundleName) Get the named bundle, such as "com/acme/Foo". boolean hasActionErrors() Check whether there are any Action-level error messages. boolean hasActionMessages() Checks whether there are any Action-level messages. boolean hasErrors() Checks whether there are any action errors or field errors. boolean hasFieldErrors() Check whether there are any field errors associated with this action. boolean hasKey(String key) Checks if a message key exists. String input() void pause(String result) 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 setActionErrors(Collection errorMessages) Set the Collection of Action-level String error messages. void setActionMessages(Collection messages) Set the Collection of Action-level String messages (not errors). void setContainer(Container container) void setFieldErrors(Map> errorMap) Set the field error map of fieldname (String) to Collection of String error messages. void validate() A default implementation that validates nothing. 从类 java.lang.Object 继承的方法 equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 构造方法详细信息 ActionSupport public ActionSupport()方法详细信息 setActionErrors public void setActionErrors(Collection errorMessages)从接口 ValidationAware 复制的描述 Set the Collection of Action-level String error messages. 指定者: 接口 ValidationAware 中的 setActionErrors 参数: errorMessages - Collection of String error messages -------------------------------------------------------------------------------- getActionErrors public Collection getActionErrors()从接口 ValidationAware 复制的描述 Get the Collection of Action-level error messages for this action. Error messages should not be added directly here, as implementations are free to return a new Collection or an Unmodifiable Collection. 指定者: 接口 ValidationAware 中的 getActionErrors 返回: Collection of String error messages -------------------------------------------------------------------------------- setActionMessages public void setActionMessages(Collection messages)从接口 ValidationAware 复制的描述 Set the Collection of Action-level String messages (not errors). 指定者: 接口 ValidationAware 中的 setActionMessages 参数: messages - Collection of String messages (not errors). -------------------------------------------------------------------------------- getActionMessages public Collection getActionMessages()从接口 ValidationAware 复制的描述 Get the Collection of Action-level messages for this action. Messages should not be added directly here, as implementations are free to return a new Collection or an Unmodifiable Collection. 指定者: 接口 ValidationAware 中的 getActionMessages 返回: Collection of String messages -------------------------------------------------------------------------------- getErrorMessages @Deprecated public Collection getErrorMessages()已过时。 Use getActionErrors(). -------------------------------------------------------------------------------- getErrors @Deprecated public Map> getErrors()已过时。 Use getFieldErrors(). -------------------------------------------------------------------------------- setFieldErrors public void setFieldErrors(Map> errorMap)从接口 ValidationAware 复制的描述 Set the field error map of fieldname (String) to Collection of String error messages. 指定者: 接口 ValidationAware 中的 setFieldErrors 参数: errorMap - field error map -------------------------------------------------------------------------------- getFieldErrors public Map> getFieldErrors()从接口 ValidationAware 复制的描述 Get the field specific errors associated with this action. Error messages should not be added directly here, as implementations are free to return a new Collection or an Unmodifiable Collection. 指定者: 接口 ValidationAware 中的 getFieldErrors 返回: Map with errors mapped from fieldname (String) to Collection of String error messages -------------------------------------------------------------------------------- getLocale public Locale getLocale()从接口 LocaleProvider 复制的描述 Gets the provided locale. 指定者: 接口 LocaleProvider 中的 getLocale 返回: the locale. -------------------------------------------------------------------------------- hasKey public boolean hasKey(String key)从接口 TextProvider 复制的描述 Checks if a message key exists. 指定者: 接口 TextProvider 中的 hasKey 参数: key - message key to check for 返回: boolean true if key exists, false otherwise. -------------------------------------------------------------------------------- getText public String getText(String aTextName)从接口 TextProvider 复制的描述 Gets a message based on a message key, or null if no message is found. 指定者: 接口 TextProvider 中的 getText 参数: aTextName - the resource bundle key that is to be searched for 返回: the message as found in the resource bundle, or null if none is found. -------------------------------------------------------------------------------- getText public String getText(String aTextName, String defaultValue)从接口 TextProvider 复制的描述 Gets a message based on a key, or, if the message is not found, a supplied default value is returned. 指定者: 接口 TextProvider 中的 getText 参数: aTextName - the resource bundle key that is to be searched for defaultValue - the default value which will be returned if no message is found 返回: the message as found in the resource bundle, or defaultValue if none is found -------------------------------------------------------------------------------- getText public String getText(String aTextName, String defaultValue, String obj)从接口 TextProvider 复制的描述 Gets a message based on a key using the supplied obj, as defined in MessageFormat, or, if the message is not found, a supplied default value is returned. 指定者: 接口 TextProvider 中的 getText 参数: aTextName - the resource bundle key that is to be searched for defaultValue - the default value which will be returned if no message is found obj - obj to be used in a MessageFormat message 返回: the message as found in the resource bundle, or defaultValue if none is found -------------------------------------------------------------------------------- getText public String getText(String aTextName, List<?> args)从接口 TextProvider 复制的描述 Gets a message based on a key using the supplied args, as defined in MessageFormat, or null if no message is found. 指定者: 接口 TextProvider 中的 getText 参数: aTextName - the resource bundle key that is to be searched for args - a list args to be used in a MessageFormat message 返回: the message as found in the resource bundle, or null if none is found. -------------------------------------------------------------------------------- getText public String getText(String key, String[] args)从接口 TextProvider 复制的描述 Gets a message based on a key using the supplied args, as defined in MessageFormat, or null if no message is found. 指定者: 接口 TextProvider 中的 getText 参数: key - the resource bundle key that is to be searched for args - an array args to be used in a MessageFormat message 返回: the message as found in the resource bundle, or null if none is found. -------------------------------------------------------------------------------- getText public String getText(String aTextName, String defaultValue, List<?> args)从接口 TextProvider 复制的描述 Gets a message based on a key using the supplied args, as defined in MessageFormat, or, if the message is not found, a supplied default value is returned. 指定者: 接口 TextProvider 中的 getText 参数: aTextName - the resource bundle key that is to be searched for defaultValue - the default value which will be returned if no message is found args - a list args to be used in a MessageFormat message 返回: the message as found in the resource bundle, or defaultValue if none is found -------------------------------------------------------------------------------- getText public String getText(String key, String defaultValue, String[] args)从接口 TextProvider 复制的描述 Gets a message based on a key using the supplied args, as defined in MessageFormat, or, if the message is not found, a supplied default value is returned. 指定者: 接口 TextProvider 中的 getText 参数: key - the resource bundle key that is to be searched for defaultValue - the default value which will be returned if no message is found args - an array args to be used in a MessageFormat message 返回: the message as found in the resource bundle, or defaultValue if none is found -------------------------------------------------------------------------------- getText public String getText(String key, String defaultValue, List<?> args, ValueStack stack)从接口 TextProvider 复制的描述 Gets a message based on a key using the supplied args, as defined in MessageFormat, or, if the message is not found, a supplied default value is returned. Instead of using the value stack in the ActionContext this version of the getText() method uses the provided value stack. 指定者: 接口 TextProvider 中的 getText 参数: key - the resource bundle key that is to be searched for defaultValue - the default value which will be returned if no message is found args - a list args to be used in a MessageFormat message stack - the value stack to use for finding the text 返回: the message as found in the resource bundle, or defaultValue if none is found -------------------------------------------------------------------------------- getText public String getText(String key, String defaultValue, String[] args, ValueStack stack)从接口 TextProvider 复制的描述 Gets a message based on a key using the supplied args, as defined in MessageFormat, or, if the message is not found, a supplied default value is returned. Instead of using the value stack in the ActionContext this version of the getText() method uses the provided value stack. 指定者: 接口 TextProvider 中的 getText 参数: key - the resource bundle key that is to be searched for defaultValue - the default value which will be returned if no message is found args - an array args to be used in a MessageFormat message stack - the value stack to use for finding the text 返回: the message as found in the resource bundle, or defaultValue if none is found -------------------------------------------------------------------------------- getFormatted public String getFormatted(String key, String expr)Dedicated method to support I10N and conversion errors 参数: key - message which contains formatting string expr - that should be formatted 返回: formatted expr with format specified by key -------------------------------------------------------------------------------- getTexts public ResourceBundle getTexts()从接口 TextProvider 复制的描述 Get the resource bundle associated with the implementing class (usually an action). 指定者: 接口 TextProvider 中的 getTexts 返回: the bundle -------------------------------------------------------------------------------- getTexts public ResourceBundle getTexts(String aBundleName)从接口 TextProvider 复制的描述 Get the named bundle, such as "com/acme/Foo". 指定者: 接口 TextProvider 中的 getTexts 参数: aBundleName - the name of the resource bundle, such as "com/acme/Foo". 返回: the bundle -------------------------------------------------------------------------------- addActionError public void addActionError(String anErrorMessage)从接口 ValidationAware 复制的描述 Add an Action-level error message to this Action. 指定者: 接口 ValidationAware 中的 addActionError 参数: anErrorMessage - the error message -------------------------------------------------------------------------------- addActionMessage public void addActionMessage(String aMessage)从接口 ValidationAware 复制的描述 Add an Action-level message to this Action. 指定者: 接口 ValidationAware 中的 addActionMessage 参数: aMessage - the message -------------------------------------------------------------------------------- addFieldError public void addFieldError(String fieldName, String errorMessage)从接口 ValidationAware 复制的描述 Add an error message for a given field. 指定者: 接口 ValidationAware 中的 addFieldError 参数: fieldName - name of field errorMessage - the error message -------------------------------------------------------------------------------- input public String input() throws Exception抛出: Exception -------------------------------------------------------------------------------- doDefault public String doDefault() throws Exception抛出: Exception -------------------------------------------------------------------------------- execute public String execute() throws ExceptionA default implementation that does nothing an returns "success". Subclasses should override this method to provide their business logic. See also Action.execute(). 指定者: 接口 Action 中的 execute 返回: returns Action.SUCCESS 抛出: Exception - can be thrown by subclasses. -------------------------------------------------------------------------------- hasActionErrors public boolean hasActionErrors()从接口 ValidationAware 复制的描述 Check whether there are any Action-level error messages. 指定者: 接口 ValidationAware 中的 hasActionErrors 返回: true if any Action-level error messages have been registered -------------------------------------------------------------------------------- hasActionMessages public boolean hasActionMessages()从接口 ValidationAware 复制的描述 Checks whether there are any Action-level messages. 指定者: 接口 ValidationAware 中的 hasActionMessages 返回: true if any Action-level messages have been registered -------------------------------------------------------------------------------- hasErrors public boolean hasErrors()从接口 ValidationAware 复制的描述 Checks whether there are any action errors or field errors. Note: that this does not have the same meaning as in WW 1.x. 指定者: 接口 ValidationAware 中的 hasErrors 返回: (hasActionErrors() || hasFieldErrors()) -------------------------------------------------------------------------------- hasFieldErrors public boolean hasFieldErrors()从接口 ValidationAware 复制的描述 Check whether there are any field errors associated with this action. 指定者: 接口 ValidationAware 中的 hasFieldErrors 返回: whether there are any field errors -------------------------------------------------------------------------------- clearFieldErrors public void clearFieldErrors()Clears field errors. Useful for Continuations and other situations where you might want to clear parts of the state on the same action. -------------------------------------------------------------------------------- clearActionErrors public void clearActionErrors()Clears action errors. Useful for Continuations and other situations where you might want to clear parts of the state on the same action. -------------------------------------------------------------------------------- clearMessages public void clearMessages()Clears messages. Useful for Continuations and other situations where you might want to clear parts of the state on the same action. -------------------------------------------------------------------------------- clearErrors public void clearErrors()Clears all errors. Useful for Continuations and other situations where you might want to clear parts of the state on the same action. -------------------------------------------------------------------------------- clearErrorsAndMessages public void clearErrorsAndMessages()Clears all errors and messages. Useful for Continuations and other situations where you might want to clear parts of the state on the same action. -------------------------------------------------------------------------------- validate public void validate()A default implementation that validates nothing. Subclasses should override this method to provide validations. 指定者: 接口 Validateable 中的 validate -------------------------------------------------------------------------------- clone public Object clone() throws CloneNotSupportedException覆盖: 类 Object 中的 clone 抛出: CloneNotSupportedException -------------------------------------------------------------------------------- pause public void pause(String result)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. The next time this action is invoked (and using the same continuation ID), the method will resume immediately after where this method was called, with the entire call stack in the execute method restored. Note: this method can only be called within the execute() method. 参数: result - the result to return - the same type of return value in the execute() method. -------------------------------------------------------------------------------- setContainer public void setContainer(Container container) -------------------------------------------------------------------------------- 概述 软件包 类 使用 树 已过时 索引 帮助 上一个类 下一个类 框架 无框架 所有类 摘要: 嵌套 | 字段 | 构造方法 | 方法 详细信息: 字段 | 构造方法 | 方法 --------------------------------------------------------------------------------

50,542

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧