简体   繁体   English

原因:没有为类型为“链”的名称定义为“成功”的结果类型

[英]Caused by: There is no result type defined for type 'chain' mapped with name 'success'

Exception while trying with Chaining.Exception comes here 尝试使用Chaining时出现异常。

<action name="chain1" class="leo.struts.Chain1Action">

<!-- Chain Result configuration starts -->
    <package name="interceptorpackage">
        <interceptors>
            <interceptor name="chainingintercept1" class="leo.struts.SimpleInterceptor" />
            <interceptor name="chainingintercept2" class="leo.struts.LoggingInterceptor">
                <param name="name">leo</param>
            </interceptor>
            <interceptor name="chainingintercept3" class="leo.struts.ChainInterceptor" />
        </interceptors>
    </package>
    <package name="public" extends="interceptorpackage">
        <action name="chain1" class="leo.struts.Chain1Action">
            <interceptor-ref name="chainingintercept1"/>
            <result type="chain">chain2</result>
        </action>

        <action name="chain2" class="leo.struts.Chain2Action">
            <!-- Chain to another namespace -->
            <interceptor-ref name="chainingintercept2"/>
            <result type="chain">
                <param name="actionName">chain3</param>
                <param name="namespace">/secure</param>
            </result>
        </action>
    </package>

    <package name="secure" extends="interceptorpackage" namespace="/secure">
        <action name="chain3" class="leo.struts.Chain3Action">
                <interceptor-ref name="chainingintercept3"/>
            <result >noresultend.jsp</result>
        </action>
    </package>
    <!-- Chain Result configuration starts -->

Exception : 例外情况:

SEVERE: Exception starting filter struts2
Error building results for action chain1 in namespace  - action - file:/D:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Strut2Examples/WEB-INF/classes/struts.xml:135:57
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:340)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:429)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:239)
    at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
    at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:152)
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)
    at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
    at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4072)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4726)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
    at org.apache.catalina.core.StandardService.start(StandardService.java:525)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: There is no result type defined for type 'chain' mapped with name 'success' - result - file:/D:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Strut2Examples/WEB-INF/classes/struts.xml:137:25
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.buildResults(XmlConfigurationProvider.java:584)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:338)
    ... 26 more

If you define type in the result configuration, the value for the result type should be defined in the package config or inherited from super packages. 如果在结果配置中定义类型,则结果类型的值应在程序包配置中定义或从超级程序包继承。 The result type "chain" is defined in the package "struts-default" that your base package should inherit. 结果类型"chain"在基本包应继承的包"struts-default"中定义。 If you don't want to use a default result type then you can define your own type according to DTD. 如果您不想使用默认结果类型,则可以根据DTD定义自己的类型。

<package name="interceptorpackage" extends="struts-default" abstract="true">
  <result-types>
    <result-type name="chain" class="com.opensymphony.xwork2.ActionChainResult"/>
  <result-types>

In this configuration the result type "chain" is defined in the parent package "struts-default" and overridden in your package. 在此配置中,结果类型"chain"在父包"struts-default"定义,并在您的包中被覆盖。 To define a result type enough to either inherit a result type or define your own with possibility to override it. 要定义一个足以继承结果类型或定义自己的结果类型(有可能覆盖它)的结果类型。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 没有为名称为“成功”的“redirect-action”类型定义结果类型 - There is no result type defined for type 'redirect-action' mapped with name 'success' 没有为类型“ jasper”定义名称为“ success”的结果类型 - There is no result type defined for type 'jasper' mapped with name 'success' 没有为使用名称“success”映射的“dynamic-jasper”类型定义结果类型 - There is no result type defined for type 'dynamic-jasper' mapped with name 'success' 没有使用 Struts 2 jQuery Grid 为名称“成功”映射的“json”类型定义结果类型 - There is no result type defined for type 'json' mapped with name 'success' using Struts 2 jQuery Grid 原因:没有为名为“成功”的结果指定结果类型,也许父包未指定结果类型? - Caused by: No result type specified for result named 'success', perhaps the parent package does not specify the result type? 使用 JPA 的 UUID 映射类型 - UUID mapped type using JPA 通用类型声明导致错误 - Generic type declaration caused an error 具有 void 返回类型的链选项 - Chain optionals with void return type 无法使用 IntelliJ 创建类。 作为文件 > 名称映射到不是 java 文件类型“文本” - Unable to create classes with IntelliJ. As file > name mapped to not java file type 'Text' Spring 数据 Rest 错误:原因:org.springframework.data.mapping.PropertyReferenceException:找不到类型项目的属性名称 - Spring Data Rest error: Caused by: org.springframework.data.mapping.PropertyReferenceException: No property name found for type Project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM