Package org.apache.tiles.context.portlet

Examples of org.apache.tiles.context.portlet.PortletTilesApplicationContext


            ServletContext servletContext = (ServletContext) context;
            return new ServletTilesApplicationContext(servletContext);

        } else if (context instanceof PortletContext) {
            PortletContext portletContext = (PortletContext) context;
            return new PortletTilesApplicationContext(portletContext);
        } else {
            throw new IllegalArgumentException("Invalid context specified. "
                + context.getClass().getName());
        }
    }
View Full Code Here


        if (servletContext != null) {
            return new ServletTilesRequestContext(servletContext,
                (HttpServletRequest) request,
                (HttpServletResponse) response);
        } else if (portletContext != null) {
            PortletTilesApplicationContext app = (PortletTilesApplicationContext) context;
            return new PortletTilesRequestContext(app.getPortletContext(),
                (PortletRequest) request,
                (PortletResponse) response);
        } else {
            throw new IllegalArgumentException("Invalid context specified. "
                + context.getClass().getName());
View Full Code Here

    }

    protected PortletContext getPortletContext(TilesApplicationContext context) {
        if (context instanceof PortletTilesApplicationContext) {
            PortletTilesApplicationContext app = (PortletTilesApplicationContext) context;
            return app.getPortletContext();
        }
        return null;
    }
View Full Code Here

    /** {@inheritDoc} */
    public TilesApplicationContext createApplicationContext(Object context) {
        if (context instanceof PortletContext) {
            PortletContext portletContext = (PortletContext) context;
            return new PortletTilesApplicationContext(portletContext);
        }
       
        return null;
    }
View Full Code Here

    public TilesRequestContext createRequestContext(TilesApplicationContext context,
                                                    Object... requestItems) {
        if (requestItems.length == 2) {
            PortletContext portletContext = getPortletContext(context);
            if (portletContext != null) {
                PortletTilesApplicationContext app = (PortletTilesApplicationContext) context;
                return new PortletTilesRequestContext(app.getPortletContext(),
                    (PortletRequest) requestItems[0],
                    (PortletResponse) requestItems[1]);
            }
        }
       
View Full Code Here

     * @param context The application context.
     * @return The original portlet context, if found.
     */
    protected PortletContext getPortletContext(TilesApplicationContext context) {
        if (context instanceof PortletTilesApplicationContext) {
            PortletTilesApplicationContext app = (PortletTilesApplicationContext) context;
            return app.getPortletContext();
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of org.apache.tiles.context.portlet.PortletTilesApplicationContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.