private boolean processPageForward( String pagePath, HttpServletRequest request, HttpServletResponse response )
        throws IOException, ServletException
    {
        Class pageServletClass = ( Class ) _pageServletClasses.get( pagePath );

        if ( pageServletClass == null )
        {
            pageServletClass = Void.class;
            ClassLoader cl = DiscoveryUtils.getClassLoader();
            String path = "META-INF/pageflow-page-servlets" + pagePath + ".properties";
            InputStream in = cl.getResourceAsStream( path );

            if ( in != null )
            {
                String className = null;

                try
                {
                    Properties props = new Properties();
                    props.load( in );
                    className = props.getProperty( _servletContainerAdapter.getPlatformName() );
                    if ( className == null ) className = props.getProperty( "default" );

                    if ( className != null )
                    {
                        pageServletClass = cl.loadClass( className );

                        if ( Servlet.class.isAssignableFrom( pageServletClass ) )
                        {
                            if ( LOG.isInfoEnabled() )
                            {
                                LOG.info( "Loaded page Servlet class " + className + " for path " + pagePath );
                            }
                        }
                        else
                        {
                            pageServletClass = Void.class;
                            LOG.error( "Page Servlet class " + className + " for path " + pagePath
                                        + " does not extend " + Servlet.class.getName() );
                        }
                    }
                }
                catch ( IOException e )
                {
                    LOG.error( "Error while reading " + path, e );
                }
                catch ( ClassNotFoundException e )
                {
                    LOG.error( "Error while loading page Servlet class " + className, e );
                }
            }

            _pageServletClasses.put( pagePath, pageServletClass );
        }

        if ( pageServletClass.equals( Void.class ) )
        {
            return false;
        }

        try
        {
            Servlet pageServlet = ( Servlet ) pageServletClass.newInstance();
            pageServlet.init( new PageServletConfig( pagePath ) );

            ensurePageServletFilter().doFilter( request, response, new PageServletFilterChain( pageServlet ) );
            return true;
        }
        catch ( InstantiationException e )
        {
            LOG.error( "Error while instantiating page Servlet of type " + pageServletClass.getName(), e );
        }
        catch ( IllegalAccessException e )
        {
            LOG.error( "Error while instantiating page Servlet of type " + pageServletClass.getName(), e );
        }

        return false;
    }
private boolean processPageForward ( String pagePath , HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { Class pageServletClass = ( Class ) _pageServletClasses . get ( pagePath ) ; if ( pageServletClass == null ) { pageServletClass = Void . class ; ClassLoader cl = DiscoveryUtils . getClassLoader ( ) ; String path = "META-INF/pageflow-page-servlets" + pagePath + ".properties" ; InputStream in = cl . getResourceAsStream ( path ) ; if ( in != null ) { String className = null ; try { Properties props = new Properties ( ) ; props . load ( in ) ; className = props . getProperty ( _servletContainerAdapter . getPlatformName ( ) ) ; if ( className == null ) className = props . getProperty ( "default" ) ; if ( className != null ) { pageServletClass = cl . loadClass ( className ) ; if ( Servlet . class . isAssignableFrom ( pageServletClass ) ) { if ( LOG . isInfoEnabled ( ) ) { LOG . info ( "Loaded page Servlet class " + className + " for path " + pagePath ) ; } } else { pageServletClass = Void . class ; LOG . error ( "Page Servlet class " + className + " for path " + pagePath + " does not extend " + Servlet . class . getName ( ) ) ; } } } catch ( IOException e ) { LOG . error ( "Error while reading " + path , e ) ; } catch ( ClassNotFoundException e ) { LOG . error ( "Error while loading page Servlet class " + className , e ) ; } } _pageServletClasses . put ( pagePath , pageServletClass ) ; } if ( pageServletClass . equals ( Void . class ) ) { return false ; } try { Servlet pageServlet = ( Servlet ) pageServletClass . newInstance ( ) ; pageServlet . init ( new PageServletConfig ( pagePath ) ) ; ensurePageServletFilter ( ) . doFilter ( request , response , new PageServletFilterChain ( pageServlet ) ) ; return true ; } catch ( InstantiationException e ) { LOG . error ( "Error while instantiating page Servlet of type " + pageServletClass . getName ( ) , e ) ; } catch ( IllegalAccessException e ) { LOG . error ( "Error while instantiating page Servlet of type " + pageServletClass . getName ( ) , e ) ; } return false ; }
An opportunity to process a page forward in a different way than performing a server forward.  The default
implementation looks for a file on classpath called
META-INF/pageflow-page-servlets/<i>path-to-page</i>.properties (e.g.,
"/META-INF/pageflow-page-servlets/foo/bar/hello.jsp.properties").  This file contains mappings from
<i>platform-name</i> (the value returned by {@link ServletContainerAdapter#getPlatformName}) to the name of a Servlet
class that will process the page request.  If the current platform name is not found, the value "default" is
tried.  An example file might look like this:
<pre>
tomcat=org.apache.jsp.foo.bar.hello_jsp
default=my.servlets.foo.bar.hello
</pre>
@param pagePath the webapp-relative path to the page, e.g., "/foo/bar/hello.jsp"
@param request the current HttpServletRequest
@param response the current HttpServletResponse
@return <code>true</code> if the method handled the request, in which case it should not be forwarded.
@throws IOException
@throws ServletException