-
1. Re: seam-catch - @sendHttpError not found ??
lightguard Jan 29, 2013 12:12 PM (in response to rahul22)What Dan was talking about was simply an example. The closest thing is from Seam Rest: https://github.com/seam/rest/blob/develop/examples/exceptions/src/main/java/org/jboss/seam/rest/examples/exceptions/CatchExceptionHandlers.java
If you're not using Seam Rest then you'd have to create something similar, however, with JSF you have to know in which phase the exception occurred. If it was during RENDER_RESPONSE, you cannot send a redirect or HTTP error code.
-
2. Re: seam-catch - @sendHttpError not found ??
rahul22 Jan 29, 2013 12:55 PM (in response to lightguard)hi
i want some thing similar to @HttpError annotation in seam 3 ???
and see to this https://community.jboss.org/message/789679#789679 .
Thanks
-
3. Re: seam-catch - @sendHttpError not found ??
rahul22 Jan 30, 2013 4:11 AM (in response to rahul22)hi,
one question ,
i can write as many methods inside one handler like :-
@HandlesExceptions
public class ExceptionHandler {
void handleException(@Handles CaughtException<xyz> caught, HttpServletResponse response){
try {
response.sendError(404);
caught.handled();
} catch (IOException e) {
e.printStackTrace();
}
}
void handle(@Handles CaughtException<abc> caught, HttpServletResponse response){
try {
response.sendError(403);
caught.handled();
} catch (IOException e) {
e.printStackTrace();
}
}
}
??????????????
Thanks
-
4. Re: seam-catch - @sendHttpError not found ??
vijay.duvvuri Jan 30, 2013 11:12 AM (in response to rahul22)Yes, you can.
Also, If you are handling the same exception in different methods - see http://docs.jboss.org/seam/3/latest/reference/en-US/html/catch-client_usage.html#precedence