Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Weblogic behaviour when using error-page in web.xml descriptor and a reference to a spring-mvc contr

2664072Apr 30 2014 — edited Apr 30 2014

Hi,

I'm struggling with a very odd behaviour in Weblogic when using the error-page tag in web.xml. The point is that when we configure the location of the error page to reference an URL that Spring-MVC should intercept, in practice what happens is that the Weblogic returns en 404 error saying that the resource specified in the location tag doesn't exist.

web.xml

<servlet>

    <servlet-name>services</servlet-name>

    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>

    <load-on-startup>1</load-on-startup>

  </servlet>

<servlet-mapping>

    <servlet-name>services</servlet-name>

    <url-pattern>/404.html</url-pattern>

  </servlet-mapping>

<error-page>

    <error-code>404</error-code>

    <location>/404.html</location>

  </error-page>

spring-context.xml

<mvc:view-controller path="/404.html" view-name="404" />

The same application deployed in a Tomcat works perfectly and returns the view specified in the Spring configuration but It doesn't in Weblogic. It's like Spring coudn't intercept the URL specified in "location" tag when the app is installed in Weblogic.

I have already tested the Spring configuration using directly the URL of the "/404.html" controller and it returns the right view.

Any ideas about what's going on?

Thanks in advance

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 28 2014
Added on Apr 30 2014
1 comment
1,469 views