if ( forwardedForm != null )
{
forwardedFormClass = forwardedForm.getClass();
List/*< ActionMapping >*/ possibleMatches = ( List ) _overloadedActions.get( path );
ActionMapping bestMatch = null;
//
// Troll through the overloaded actions for the given path. Look for the one whose form bean class is
// exactly the class of the forwarded form; failing that, look for one that's assignable from the class
// of the forwarded form.
//
for ( int i = 0; possibleMatches != null && i < possibleMatches.size(); ++i )
{
ActionMapping possibleMatch = ( ActionMapping ) possibleMatches.get( i );
assert possibleMatch instanceof PageFlowActionMapping : possibleMatch.getClass();
Class cachedFormBeanClass = ( Class ) _formBeanClasses.get( possibleMatch.getName() );
if ( forwardedFormClass.equals( cachedFormBeanClass ) )
{
bestMatch = possibleMatch;
break;
}
if ( bestMatch == null && isCorrectFormType( forwardedFormClass, possibleMatch ) )
{
bestMatch = possibleMatch;
}
}
if ( bestMatch != null )
{
request.setAttribute( Globals.MAPPING_KEY, bestMatch );
if ( _log.isDebugEnabled() )
{
_log.debug( "Found form-specific action mapping " + bestMatch.getPath() + " for " + path
+ ", form " + forwardedFormClass.getName() );
}
return checkTransaction( request, response, bestMatch, path );
}
}
//
// Look for a directly-defined mapping for this path.
//
ActionMapping mapping = ( ActionMapping ) moduleConfig.findActionConfig( path );
if ( mapping != null )
{
boolean wrongForm = false;
//
// We're going to bail out if there is a forwarded form and this mapping requires a different form type.
//
if ( forwardedForm != null )
{
boolean mappingHasNoFormBean = mapping.getName() == null;
wrongForm = mappingHasNoFormBean || ! isCorrectFormType( forwardedFormClass, mapping );
}
if ( ! wrongForm )
{