struts2与struts1整合,Unable to load configuration. - interceptor-ref ... struts.xml

struts.xml中为了与struts1的MVC模式整合,需要类似如下的拦截器的引用

<interceptor-stack name="integration">
                <interceptor-ref name="static-params"/>
                <interceptor-ref name="loginForm"/>
                <interceptor-ref name="model-driven"/>
                <interceptor-ref name="actionForm-reset"/>
                <interceptor-ref name="basicStack"/>
                <interceptor-ref name="actionForm-validation"/>
                <interceptor-ref name="workflow"/>
            </interceptor-stack>

这里面拦截器的name有问题(我是从教材的源代码直接拷贝过来的)

查看struts2-struts1-plugin-2.3.16.3.jar里面的struts-plugin.xml

可以看到上面引用的拦截器的名字是

<interceptors>
            <interceptor name="actionForm-reset" class="org.apache.struts2.s1.ActionFormResetInterceptor"/>
            <interceptor name="actionForm-validation" class="org.apache.struts2.s1.ActionFormValidationInterceptor"/>
            <interceptor name="actionForm-commonsValidation" class="org.apache.struts2.s1.ActionFormValidationInterceptor">
              <param name="pathnames">/org/apache/struts/validator/validator-rules.xml,/WEB-INF/validation.xml</param>
            </interceptor>
            <interceptor-stack name="struts1Stack">
          <interceptor-ref name="staticParams"/>
          <interceptor-ref name="scopedModelDriven"/>
          <interceptor-ref name="modelDriven"/>
                <interceptor-ref name="actionForm-reset"/>
                <interceptor-ref name="basicStack"/>
                <interceptor-ref name="actionForm-validation"/>
                <interceptor-ref name="workflow"/>
        </interceptor-stack>
        </interceptors>

        <default-interceptor-ref name="struts1Stack"/>

所以,应该是staticParams,modelDriven,而不是static-params,model-driven

struts2与struts1整合,Unable to load configuration. - interceptor-ref ... struts.xml,布布扣,bubuko.com

时间: 2024-08-07 04:34:03

struts2与struts1整合,Unable to load configuration. - interceptor-ref ... struts.xml的相关文章

struts2 jar包导入Unable to load configuration. - bean问题 (404 源服务器未能找到目标资源的表示或者是不愿公开一个已经存在的资源表示。)

用eclipse配置好了struts2,一运行tomcat就报错,我这里原因是我吧struts2的jar包都放进去了,太多了所以报错,然后我去掉了大部分留下几个核心jar包,还是报错, java.lang.NoClassDefFoundError: com/opensymphony/xwork2/ActionContext at org.apache.struts2.dispatcher.ng.InitOperations.cleanup(InitOperations.java:114) at

启动tomcat后struts框架报异常严重: Exception starting filter struts2 Unable to load configuration.

启动tomcat后struts框架报异常严重: Exception starting filter struts2 Unable to load configuration. 出现此异常是因为,struts.xml定义的版本和 struts2-core-2.1.6.jar里面的struts-default.xml版本不一致!! struts-default.xml文件里面定义的<!DOCTYPE ...>如下: <!DOCTYPE struts PUBLIC "-//Apach

启动tomcat后struts框架报异常严重: Exception starting filter struts2 Unable to load configuration. - Class: java.net.PlainSocketImpl

今天刚好宿舍断网,打开电脑,打开ide工具,启动tomcat后,访问web项目工程,页面显示404,查看控制台,运行报错信息如下: 严重: Exception starting filter struts2Unable to load configuration. - Class: java.net.PlainSocketImplFile: PlainSocketImpl.javaMethod: connectLine: 177 - java/net/PlainSocketImpl.java:1

严重: Exception starting filter struts2 Unable to load configuration

MVC框架的学习中出现这一问题: 严重: Exception starting filter struts2 Unable to load configuration. - action - file:/E:/Tomcat/apache-tomcat-8.0.24-windows-x64/apache-tomcat-8.0.24/webapps/test18/WEB-                INF/classes/cityoa.xml:8:64 原因:忘了加载 struts2-sprin

idea整合struts和spring和hibernate时候的导jar错误:Unable to load configuration. - action -

org.apache.struts2.dispatcher.Dispatcher.error Dispatcher initialization failed Unable to load configuration. - action - file:/F:/Documents/MyJava/SSH001/out/artifacts/SSH001_war_exploded/WEB-INF/classes/struts.xml:11:66 Caused by: Action class [empl

Struts2中的Unable to load configuration错误的分析与解决方法

当我们遇到 Unable to load configuration. 这样的错误时,可以根据具体的错误提示找出错误的原因. Unable to load configuration. - interceptor-ref - file:/D:/Java/apache-tomcat-6.0.32/webapps/examquestions/WEB-INF/classes/struts.xml:28:49 at com.opensymphony.xwork2.config.Configuration

struts2与struts1整合,java.lang.InstantiationException, Exception occurred during processing request: null

做了2个action,其中一个运行没有问题,另一个报错,看下面的报错信息,再看了看struts.xml,因为没有给GetBooks这个action配置actionform,所以就导致报null.下面是有问题的struts.xml,其中主要的问题就是没有给GetBooks这个action配置actionform,也就是没有添加那个interceptor-ref name="integration",添加上就好了(这个form在应用的逻辑里面,GetBooks是不需要form的,但是可能是

Unable to load configuration. - Class: java.net.AbstractPlainSocketImpl

[Bug笔记]Unable to load configuration. - Class: java.net.AbstractPlainSocketImpl 标签: bugjartomcat服务器互联网 2014-04-29 10:44 1491人阅读 评论(0) 收藏 举报 分类: Bug笔记(8) 版权声明:本文为博主原创文章,未经博主允许不得转载. 最近出了一件怪事,在联网状态下启动Tomcat和没有联网状态下启动Tomcat会出现两种不同的结果:正常启动和报错 于是自己纠结了半天,查找原

Unable to load configuration. - action - file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%209.0/webapps/Teacher04/WEB-INF/classes/struts.xml:9:54

发布一个struts2项目的时候tomcat显示下面这个错误,我的本能感觉就是我的struts.xml或者web.xml写错了,可是我字母找都没发现,于是百度一番,可是我对那些人的回答表示怀疑,感觉应该不行,直到我一直找下去,发现一个不起眼的回答说出了我需要的回答 我回来一看,发现我的错误里的确有这个struts.xml:9:54,于是看一下我的struts.xml,我要哭了 严重: Exception starting filter struts2 Unable to load configu