// beforeAction callback
//
beforeAction();
gotPastBeforeAction = true;
PageFlowActionMapping pfActionMapping =
mapping instanceof PageFlowActionMapping ? ( PageFlowActionMapping ) mapping : null;
Object unwrappedForm = InternalUtils.unwrapFormBean( form );
//
// mapping.isOverloaded() means it's the base mapping for a set of overloaded mappings.
// Find the one appropriate to the passed-in form.
//
if ( unwrappedForm != null && pfActionMapping != null )
{
if ( pfActionMapping.isOverloaded() )
{
String mappingPath = pfActionMapping.getPath();
//
// Try the form class and all superclasses to get an overloaded action path.
//
for ( Class i = unwrappedForm.getClass(); i != null; i = i.getSuperclass() )
{
String formQualifiedActionPath = getFormQualifiedActionPath( i, mappingPath );
ActionConfig cf = pfActionMapping.getModuleConfig().findActionConfig( formQualifiedActionPath );
if ( cf != null )
{
assert cf instanceof PageFlowActionMapping : cf.getClass().getName();
if ( _log.isDebugEnabled() )
{
_log.debug( "Found form-specific mapping " + cf.getPath() +
" -- choosing this one over current mapping " + mappingPath );
}
pfActionMapping = ( PageFlowActionMapping ) cf;
mapping = pfActionMapping;
break;
}
}
}
}
String actionName = InternalUtils.getActionName( mapping );
//
// Check whether isLoginRequired=true for this action.
//
LoginHandler loginHandler = Handlers.get( getServletContext() ).getLoginHandler();
if ( pfActionMapping != null && pfActionMapping.isLoginRequired()
&& loginHandler.getUserPrincipal( getHandlerContext() ) == null )
{
NotLoggedInException ex = createNotLoggedInException( actionName, request );
return handleException( ex, mapping, form, request, response );
}
//
// Now delegate to the appropriate action method, or if it's a simple action, handle it that way.
//
ActionForward retVal;
if ( pfActionMapping != null && pfActionMapping.isSimpleAction() )
{
retVal = handleSimpleAction( pfActionMapping, form, request, servletContext );
}
else
{