I have a problem that I cannot solve.
Suppose we call a method (in the bean library) from a web page (possibly jsp, xhtml, portlet ...), by pressing a button.
<h:form>
....
<h:inputText value="#{errorManager.errorTestDataBean.errore00}" />
<h:commandButton id="go" value="GO" action="#{errorManager.triggerError}" />
...
</h:form>
The form is submitted with its values.
Suppose also that in the process of action we get a problem (exception).
I wrote (and registered) an ActionListener that will catch an Unhandled Exception (and this will do something to handle it):
public class ExceptionHandlingActionListener extends ActionListenerImpl
{
public void processAction(ActionEvent event)
{
try
{
super.processAction(event);
}
catch(Exception exception)
{
exception.printStackTrace();
......... do something here ...............
FacesContext facesContext = FacesContext.getCurrentInstance();
Application application = facesContext.getApplication();
NavigationHandler navigationHandler = application.getNavigationHandler();
navigationHandler.handleNavigation(facesContext, null, "error");
facesContext.renderResponse();
}
}
}
This works fine ... BUT ... I need to know the data that (was?) In the form presented.
How can I get this information? I need a generic method, since an error can occur throughout the application (I really don't know clientId or other unique information about objects).
: !!
, JSF 1.2.
?
!