【发布时间】:2017-11-15 18:44:19
【问题描述】:
我在尝试在 WebLogic 12c 上运行的 Spring MVC / Spring Security 项目遇到问题。该项目是使用 Tomcat 创建的,但是在 WL 上我总是遇到错误 403 (http.../project/),或者当我尝试打开应该作为正常 URL 工作的内容时出现 404 (http.../project/users/ )。
该项目适用于 Spring MVC (4.3.0.RELEASE)、Spring Security (4.1.1.RELEASE) 和 Thymeleaf (3.0.1.RELEASE)
web.xml 文件包含:
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<error-page>
<error-code>404</error-code>
<location>/404</location>
</error-page>
还有 weblogic.xml
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.7/weblogic-web-app.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<context-root>project</context-root>
<session-descriptor>
<cookie-name>PROJECT</cookie-name>
<cookie-path>/project</cookie-path>
</session-descriptor>
</weblogic-web-app>
整个 Spring 配置是使用 Java 而不是 XML 文件进行的。
我一直在尝试在此处和其他论坛中找到的不同选项,但直到现在我都找不到解决方案。
【问题讨论】:
-
我使用的是 WebLogic 12.1.3.0.0
标签: java spring spring-mvc spring-security weblogic