当网址末尾没有“/”时,Weblogic会显示500错误

时间:2017-03-03 11:55:40

标签: java spring-mvc spring-security weblogic broadleaf-commerce

我有一个基于Spring的应用程序(spring-security 3.2.9.RELEASE,spring-mvc 4.1.9.RELEASE),它被部署到Weblogic 12.1.2.0.0

以下是 weblogic.xml

中的部分
<wls:context-root>/admin</wls:context-root>

的web.xml

<servlet-mapping>
    <servlet-name>admin</servlet-name>
    <url-pattern>/</url-pattern>
</servlet-mapping>

因此,当我尝试正确打开网址http://weblogicaddr:port/admin/登录页面时。

http://weblogicaddr:port/admin

我收到以下错误页面

Caused by: java.net.MalformedURLException: The path for getResource() must begin with a '/'
    at weblogic.servlet.internal.WebAppServletContext.getResource(WebAppServletContext.java:755)
    at org.broadleafcommerce.common.web.util.PrecompressedArtifactFilter.useGzipCompression(PrecompressedArtifactFilter.java:152)
    at org.broadleafcommerce.common.web.util.PrecompressedArtifactFilter.doFilter(PrecompressedArtifactFilter.java:58)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.broadleafcommerce.openadmin.web.filter.BroadleafAdminRequestFilter$1.execute(BroadleafAdminRequestFilter.java:73)
    ... 71 more

我尝试将web.xml更改为<url-pattern>/*</url-pattern>,但在部署期间出现错误

com.sun.jersey.spi.inject.Errors$ErrorMessagesException:com.sun.jersey.spi.inject.Errors.ErrorMessagesException:null

那么应该进行哪些配置更改才能获得工作网址而不必结束'/'?

0 个答案:

没有答案