Package org.ofbiz.content.webapp.view

Examples of org.ofbiz.content.webapp.view.ViewHandlerException


        HttpServletRequest request, HttpServletResponse response)
        throws ViewHandlerException {
        // some containers call filters on EVERY request, even forwarded ones,
        // so let it know that it came from the control servlet
        if (request == null) {
            throw new ViewHandlerException("Null HttpServletRequest object");
        }

        if ((page == null) || (page.length() == 0)) {
            throw new ViewHandlerException("Null or empty source");
        }

        request.setAttribute("_FORWARDED_FROM_CONTROL_SERVLET_",
            new Boolean(true));

        RequestDispatcher rd = request.getRequestDispatcher(page);

        if (rd == null) {
            throw new ViewHandlerException(
                "Source returned a null dispatcher (" + page + ")");
        }

        try {
            rd.forward(request, response);
        } catch (IOException ie) {
            throw new ViewHandlerException("IO Error in view", ie);
        } catch (ServletException e) {
            Throwable throwable = (e.getRootCause() != null) ? e.getRootCause()
                                                             : e;

            if (throwable instanceof JspException) {
                JspException jspe = (JspException) throwable;

                throwable = (jspe.getRootCause() != null) ? jspe.getRootCause()
                                                          : jspe;
            }

            Debug.logError(throwable, "ServletException rendering JSP view");
            throw new ViewHandlerException(e.getMessage(), throwable);
        }
    }
View Full Code Here

TOP

Related Classes of org.ofbiz.content.webapp.view.ViewHandlerException

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.