I am new to JBoss Seam. I have been having issues with a small project am working on. The project has some errors and unfortunately for me I cannot find out the exact cause of the errors. I get a javax.servlet.ServletException. Please could someone tell me how to add custom filters so that I would be able to trap errors properly.
Asked
Active
Viewed 952 times
0
-
Please, post the stack trace of the ServletException as seen in the log file or in the server console. – Stefano Travelli Mar 26 '11 at 08:33
1 Answers
2
If you want to trap
all synchronous exceptions happening in Seam, you extend the Exceptions
class in Seam.
@Name("org.jboss.seam.exception.exceptions")
@Scope(ScopeType.APPLICATION)
@Install(precedence = Install.APPLICATION)
@BypassInterceptors
@Transactional
public class ExceptionHandler extends Exceptions {
private static final LogProvider log = Logging.getLogProvider(ExceptionHandler.class);
public void handle(Exception ex) throws Exception {
//Here you can do whatever you want with the exception
log.error("Exception occurred : " + ex.getMessage());
super.handle(ex);
}

Shervin Asgari
- 23,901
- 30
- 103
- 143