Announcement Announcement Module
Collapse
No announcement yet.
ExceptionResolving ignored Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ExceptionResolving ignored

    Hi,

    I've a pbm using ExceptionResolving with Spring.

    my errorPage is ignored and i got a standard errorPage created by Tomcat.

    I went with a debugger into the DispatcherServlet and i've seen that my exception has been resolved and my error View got rendered.
    At the end of dispatchingServlet the httpResponse outputbuffer contain my errorPage. But still what is displayed on screen is a standard apache tomcat stackTrace.

    I've made a testing project with minimal conf :
    Here is applicationContext.xml
    <beans>

    <bean id="myController" class="myProject.controller.MyController" />

    <!-- URL MAPPING -->
    <bean id="urlMapping"
    class="org.springframework.web.servlet.handler.Sim pleUrlHandlerMapping">
    <property name="mappings">
    <props>
    <prop key="/test.htm">
    myController
    </prop>
    </props>
    </property>
    </bean>

    <bean id="handlerExceptionResolver" class="org.springframework.web.servlet.handler.Sim pleMappingExceptionResolver">
    <property name="exceptionMappings">
    <props>
    <prop key="java.lang.Exception">errorPage</prop>
    </props>
    </property>
    </bean>

    <bean id="viewResolver" class="org.springframework.web.servlet.view.Intern alResourceViewResolver">
    <property name="viewClass">
    <value>org.springframework.web.servlet.view.JstlVi ew</value>
    </property>
    <property name="prefix">
    <value>/WEB-INF/jsp/</value>
    </property>
    <property name="suffix">
    <value>.jsp</value>
    </property>
    </bean>
    </beans>
    Here is web.xml :
    <web-app version="2.4">
    <servlet>
    <servlet-name>SpringDispatcher</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherSe rvlet</servlet-class>
    <init-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/applicationContext.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
    <servlet-name>SpringDispatcher</servlet-name>
    <url-pattern>*.htm</url-pattern>
    </servlet-mapping>

    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    </web-app>
    myController only throw an Exception.

    i've a /WEB-INF/jsp/errorPage.jsp which should render a helloWorld but still i got the standard apache StackTrace

    I'm using a tomcat6 server within Eclipse

    Thanks for your help
    Nono

  • #2
    This is a known bug. See http://jira.springframework.org/browse/SPR-4973. I think it will be fixed in the latest nightly builds.

    Comment


    • #3
      Thanks you very much.

      I can't use 2.5.6 as it's still not official stable version.

      I'll will use error tag in web.xml.

      Comment

      Working...
      X