小编典典

在WebLogic 12.1.3上部署应用程序时出现“找不到Struts调度程序”错误

tomcat

尝试在WebLogic 12.1.3上运行我的应用程序时出现以下错误。

找不到Struts调度程序。这通常是由于使用不带关联过滤器的Struts标记引起的。仅当请求已通过其Servlet过滤器(该过滤器初始化此标签所需的Struts调度程序)时,Struts标记才可用。

这是我的web.xml文件:

<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:web="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

<display-name>SybUI</display-name>
<!-- location of log4j config file -->
<!-- <context-param>
    <param-name>log4jConfigLocation</param-name>
    <param-value>/WEB-INF/classes/log4j2.xml</param-value>
</context-param> -->

<filter> 
    <filter-name>struts2</filter-name>
    <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
    </filter-class>
</filter>
<filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
 <listener>
    <listener-class>
        org.springframework.web.util.Log4jConfigListener
    </listener-class>
</listener>
<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener
    </listener-class>
</listener>
<listener>
    <listener-class>org.springframework.web.context.request.RequestContextListener
    </listener-class>
</listener>
<!-- <filter>
    <filter-name>SessionFilter</filter-name>
    <filter-class>com.syb.core.filter.SessionFilter</filter-class>
    <init-param>
        <param-name>avoid-urls</param-name>
        <param-value>/timeOut,/pages/timeOut.jsp,/test,/pages/test.jsp,/testMsg.action,/pages/invalidToken.jsp,/login.jsp,/logoutUser,/loginUser.action,
            /common/postloginheader.html,/js/jquery.mobile.custom.min.js,/images/plus_cyn_40.png,/js/custom.js,/css/bootstrap.min.css,/css/aos-style.css,
            /css/style.css,/js/bootstrap.min.js,/js/modernizr.min.js,/css/custom.css,/js/jquery.validate.min.js,/js/respond.min.js,/js/session1.js,/js/aos-custom.js,
            /images/wres009899.png,/images/fdic.png,/images/header_1024.jpg,/images/blue-arrow.png
        </param-value>
    </init-param>
</filter>
<filter-mapping>
    <filter-name>SessionFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>-->
    <!--<session-config>
    <session-timeout>10</session-timeout>
</session-config> -->

<welcome-file-list>
    <welcome-file>/jsp/ao/ApplicationStartUp.jsp</welcome-file>
</welcome-file-list>

<error-page>
    <error-code>404</error-code>
    <location>/jsp/common/error/Error-PageNotFound.jsp</location>
</error-page>

<error-page>
    <exception-type>java.lang.Throwable</exception-type>
    <location>/jsp/common/error/Error-PageNotFound.jsp</location>
</error-page>

阅读 317

收藏
2020-06-16

共1个答案

小编典典

如果您在JSP页面中使用了Struts标记,welcome-file-list则应该删除该标记。

[welcome-file-listweb.xml](http://www.javatpoint.com/welcome-file-

list):

welcome-file-list元素web-app用于定义欢迎文件列表。它的子元素welcome-file用于定义欢迎文件。

如果您未指定任何文件名,则欢迎文件是服务器 自动 调用的文件。

因此,没有关联的过滤器。关联的过滤器已定义为struts2映射到/*。这意味着它应该满足所有请求,除非欢迎文件由Web服务器提供。

通常,在没有执行预先操作的情况下,您不应直接访问JSP页面,这将返回dispatcher‘类型的结果。在此结果中,您可以指定要获取访问权限的JSP文件的位置。

welcome-file- list文件由Web容器,如果你浏览到您的网页内容的层次结构的文件夹,例如,如果你不使用处理.action的URL扩展,并有一个welcome- file里面,并没有映射到URL操作。在这种情况下,您不能在中使用struts标记,welcome- file因为您尝试在没有关联过滤器的情况下运行它,或者struts2过滤器已经处理了另一个请求。

2020-06-16