throws IOException, ServletException
{
//
// First check to see if we're already in a forwarded fallback request. If so, just bail.
//
PageFlowRequestWrapper rw = PageFlowRequestWrapper.get( request );
if ( rw.getOriginalServletPath() != null ) return false;
SharedFlowController sharedFlowToTry = null;
String uriBaseName = ServletUtils.getBaseName( uri );
int firstDot = uriBaseName.indexOf( '.' );
int lastDot = uriBaseName.lastIndexOf( '.' );
if ( firstDot != -1 && firstDot != lastDot )
{
String sharedFlowName = uriBaseName.substring( 0, firstDot );
try
{
RequestContext rc = new RequestContext( request, response );
Map defaultSharedFlows = FlowControllerFactory.get( getServletContext() ).getDefaultSharedFlows( rc );
if ( defaultSharedFlows != null )
{
sharedFlowToTry = ( SharedFlowController ) defaultSharedFlows.get( sharedFlowName );
uriBaseName = uriBaseName.substring( firstDot + 1 );
}
}
catch ( ClassNotFoundException e )
{
throw new ServletException( e );
}
catch ( InstantiationException e )
{
throw new ServletException( e );
}
catch ( IllegalAccessException e )
{
throw new ServletException( e );
}
}
else
{
sharedFlowToTry = FlowControllerFactory.getGlobalApp( request, response, getServletContext() );
}
//
// If we couldn't find an appropriate module, try raising the action on the (deprecated) Global.app.
//
if ( sharedFlowToTry != null )
{
InternalStringBuilder sfActionURI = new InternalStringBuilder( sharedFlowToTry.getModulePath() );
sfActionURI.append( '/' );
sfActionURI.append( uriBaseName );
rw.setOriginalServletPath( uri );
ForwardRedirectHandler frh = _handlers.getForwardRedirectHandler();
FlowControllerHandlerContext context = new FlowControllerHandlerContext( request, response, null );
frh.forward( context, sfActionURI.toString() );
return true;
}