Hi to all,
I have a problem that I am not able to solve.
Well, let's suppose that we are invoking a method (in a backing bean) from a webpage (maybe jsp, xhtml, portlet ...) 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.
Let's also suppose that we will get a problem (Exception) during the action process.
I wrote (and registered) an ActionListener that will catch the Unhandled Exception (and that will do something to handle it):
public class ExceptionHandlingActionListener extends ActionListenerImpl
{
public void processAction(ActionEvent event)
{
try
{
super.processAction(event); //+THE ERROR HAPPENS IN THE SUPER CLASS+
}
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"); /* FORWARD TO AN ERROR PAGE */
facesContext.renderResponse();
}
}
}
It works great ... BUT ... I need to know data that are (was?) in the submitted form.
How can I get this information? I would like a generic method, since the error can happen everywhere in the application (I don't really know the clientId or other peculiar information about objects).
It's also ok to get ALL posted data and write them down in the database: I will analyze data later!!
Unfortunately, we're still at JSF 1.2.
Any ideas?
Many thanks! Tommaso