質問

I'm trying migrate webapp from tomcat to jetty (with jetty-runner) and this is the problem:

In any class in my rest api I throw an Exception and in my tomcat, I had configured an error jsp to process, parse and to return a specific formatted message with json syntax. The configuration in tomcat had web.xml:

<servlet>
    <servlet-name>errorJSP</servlet-name>
    <jsp-file>/errors.jsp</jsp-file>
</servlet>
<servlet-mapping>
    <servlet-name>errorJSP</servlet-name>
    <url-pattern>/error</url-pattern>
</servlet-mapping>

<error-page>
    <error-code>500</error-code>
    <location>/error</location>
</error-page>

Now, I launch the webapp with jetty and this configuration don't run. After throw exception, the rest api return 500 and the execution don't pass by my jsp

役に立ちましたか?

解決

It works for me in my app on Jetty:

<error-page>
    <error-code>500</error-code>
    <location>/WEB-INF/jsp/error.jsp</location>
</error-page>
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top