-
1. Re: Custom error pages not (always) working with JBoss AS 7.1.1
jaikiran May 23, 2013 4:21 AM (in response to zlika)1 of 1 people found this helpfulThomas Zlika wrote:
- or return Response.status(500).build() then the default JBoss error page is displayed instead of my custom one!
Use HttpServletResponse#sendError(500) instead of setStatus. The javadoc setStatus explicitly states that the error page mechanism may not be triggered in setStatus is used.
-
2. Re: Custom error pages not (always) working with JBoss AS 7.1.1
zlika May 23, 2013 5:24 AM (in response to jaikiran)Thank you for your answer. However, I cannot see anything related to error page mechanism in the Response javadoc. Could you give me a link?
-
3. Re: Custom error pages not (always) working with JBoss AS 7.1.1
jaikiran May 23, 2013 6:10 AM (in response to zlika)I was actually talking about the HttpServletResponse http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletResponse.html#setStatus%28int%29. I don't exactly know how you would accomplish the same using the JAX-RS APIs. Someone else might have some inputs.
-
4. Re: Custom error pages not (always) working with JBoss AS 7.1.1
jaikiran May 24, 2013 2:56 AM (in response to jaikiran)You could perhaps even try asking this in the Resteasy user mailing list http://sourceforge.net/mail/?group_id=190222
-
5. Re: Custom error pages not (always) working with JBoss AS 7.1.1
robby.cornelissen May 24, 2013 6:53 AM (in response to zlika)What happens if, instead of building the response in your code, you throw a WebApplicationException (http://docs.jboss.org/resteasy/docs/2.3.6.Final/javadocs/javax/ws/rs/WebApplicationException.html) wrapping the response status?
-
6. Re: Custom error pages not (always) working with JBoss AS 7.1.1
zlika May 24, 2013 7:35 AM (in response to robby.cornelissen)I tried to use a WebApplicationException(Status.XXX) but the default JBoss error page is also displayed (which is strange, because if I throw another exception my custom error page (with HTTP code 500) is returned).