问题描述
尝试在WebLogic 12.1.3上运行我的应用程序时出现以下错误。
I have the following error while trying to run my application on WebLogic 12.1.3.
这是我的 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>
推荐答案
如果您在 welcome-file-list
中列出的JSP页面中使用Struts标记,则应将其删除。
If you are using Struts tags inside JSP page that has listed in the welcome-file-list
it should be removed.
欢迎文件是文件如果你没有指定任何文件名,那么服务器会自动调用 。
A welcome file is the file that is invoked automatically by the server, if you don't specify any file name.
因此没有关联过滤器。关联的过滤器定义为 struts2
映射到 / *
。这意味着它应该为所有请求提供服务,除非Web服务器提供欢迎文件。
And hence without associated filter. The associated filter is defined struts2
mapped to /*
. It means it should serve all requests, unless the welcome file is served by the web server.
通常情况下,如果没有事先执行操作,则不应直接访问JSP页面,而是返回调度程序
'类型结果。在此结果中,您可以指定要获取访问权限的JSP文件的位置。
Normally, you should not directly access JSP pages without prior action execution, that returns a dispatcher
' type result. In this result you can specify the location of the JSP file you want to get the access.
welcome-file-list $ c如果您导航到Web内容层次结构的文件夹,则Web容器将处理$ c>文件,例如,如果您未在URL中使用
.action
扩展名,里面有一个 welcome-file
,并且没有映射到该URL的操作。在这种情况下,您不能在 welcome-file
中使用struts标记,因为您尝试在没有关联过滤器的情况下运行它,或者struts2过滤器已经处理了另一个请求。
The welcome-file-list
files are handled by the web container if you navigate to the folder of your web content hierarchy, such as if you aren't using the .action
extension in the URL, and there's a welcome-file
inside it, and there's no action mapped to that URL. In this case you cannot use struts tags inside the welcome-file
because you are trying to run it without associated filter, or the struts2 filter is already handled another request.
这篇关于“无法找到Struts调度程序”在WebLogic 12.1.3上部署应用程序时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!