String path = ec.getPath();
// Build the forward from the exception mapping if it exists or from the form input
forward = path != null ? new ActionForward( path ) : mapping.getInputForward();
PageFlowExceptionConfig pfec = ec instanceof PageFlowExceptionConfig ? (PageFlowExceptionConfig) ec : null;
if (pfec != null && pfec.isPathContextRelative()) {
forward.setContextRelative(true);
}
// Figure out the error
if ( ex instanceof ModuleException )
{
error = ( ( ModuleException ) ex ).getError();
property = ( ( ModuleException ) ex ).getProperty();
}
else
{
if ( pfec != null )
{
String expressionMessage = pfec.getDefaultMessage();
if ( expressionMessage != null )
{
error = new ExpressionMessage( expressionMessage, new Object[]{ ex.getMessage() } );
}
}