users@glassfish.java.net

Re: JSF _at_PostConstruct and exceptions

From: <glassfish_at_javadesktop.org>
Date: Fri, 20 Feb 2009 11:48:54 PST

the forward to error page will fail if some response content has already been flushed on the socket to the web client.
in other words you need to make your @PostConstruct fail before any content is flushed.
here are some tips I've gathered:
1) reference your FBs high in the JSP so @PostConstruct is invoked earlier - could be a simple <h:outputText value="" rendered="#{myFB.whatever}"/> or <s:subview id="myFB"/>
2) increase JSP response buffer size of your app server
3) add a ServletFilter around your URI which can catch the exception and do a redirect to error page
[Message sent by forum member 'bouteill' (bouteill)]

http://forums.java.net/jive/thread.jspa?messageID=333181