Examples of ErrorPageErrorHandler


Examples of org.eclipse.jetty.servlet.ErrorPageErrorHandler

        webAppContext.setDistributable(webAppInfo.distributable);
        webAppContext.setWelcomeFiles(webAppInfo.welcomeFiles.toArray(new String[webAppInfo.welcomeFiles.size()]));
        for (Map.Entry<String, String> entry : webAppInfo.localeEncodingMappings.entrySet()) {
            this.webAppContext.addLocaleEncoding(entry.getKey(), entry.getValue());
        }
        ErrorPageErrorHandler errorHandler = (ErrorPageErrorHandler) this.webAppContext.getErrorHandler();
        for (ErrorPageInfo errorPageInfo: webAppInfo.errorPages) {
            if (errorPageInfo.exceptionType != null) {
                errorHandler.addErrorPage(errorPageInfo.exceptionType, errorPageInfo.location);
            } else {
                errorHandler.addErrorPage(errorPageInfo.errorCode, errorPageInfo.location);
            }
        }
        if (tagLibMap != null) {
            for (Map.Entry<String, String> entry : tagLibMap.entrySet()) {
                this.webAppContext.setResourceAlias(entry.getKey(), entry.getValue());
View Full Code Here

Examples of org.eclipse.jetty.servlet.ErrorPageErrorHandler

        webAppContext.setDistributable(webAppInfo.distributable);
        webAppContext.setWelcomeFiles(webAppInfo.welcomeFiles.toArray(new String[webAppInfo.welcomeFiles.size()]));
        for (Map.Entry<String, String> entry : webAppInfo.localeEncodingMappings.entrySet()) {
            this.webAppContext.addLocaleEncoding(entry.getKey(), entry.getValue());
        }
        ErrorPageErrorHandler errorHandler = (ErrorPageErrorHandler) this.webAppContext.getErrorHandler();
        for (ErrorPageInfo errorPageInfo: webAppInfo.errorPages) {
            if (errorPageInfo.exceptionType != null) {
                errorHandler.addErrorPage(errorPageInfo.exceptionType, errorPageInfo.location);
            } else {
                errorHandler.addErrorPage(errorPageInfo.errorCode, errorPageInfo.location);
            }
        }
        if (tagLibMap != null) {
            for (Map.Entry<String, String> entry : tagLibMap.entrySet()) {
                this.webAppContext.setResourceAlias(entry.getKey(), entry.getValue());
View Full Code Here

Examples of org.eclipse.jetty.servlet.ErrorPageErrorHandler

    }

    /* ------------------------------------------------------------ */
    public WebAppContext()
    {
        this(null,null,null,null,null,new ErrorPageErrorHandler(),SESSIONS|SECURITY);
    }
View Full Code Here

Examples of org.eclipse.jetty.servlet.ErrorPageErrorHandler

     * @param contextPath The context path
     * @param webApp The URL or filename of the webapp directory or war file.
     */
    public WebAppContext(String webApp,String contextPath)
    {
        this(null,contextPath,null,null,null,new ErrorPageErrorHandler(),SESSIONS|SECURITY);
        setWar(webApp);
    }
View Full Code Here

Examples of org.eclipse.jetty.servlet.ErrorPageErrorHandler

     * @param contextPath The context path
     * @param webApp The URL or filename of the webapp directory or war file.
     */
    public WebAppContext(HandlerContainer parent, String webApp, String contextPath)
    {
        this(parent,contextPath,null,null,null,new ErrorPageErrorHandler(),SESSIONS|SECURITY);
        setWar(webApp);
    }
View Full Code Here

Examples of org.eclipse.jetty.servlet.ErrorPageErrorHandler

     */
    public WebAppContext(HandlerContainer parent, String contextPath, SessionHandler sessionHandler, SecurityHandler securityHandler, ServletHandler servletHandler, ErrorHandler errorHandler,int options)
    {
        super(parent, contextPath,sessionHandler, securityHandler, servletHandler, errorHandler,options);
        _scontext = new Context();
        setErrorHandler(errorHandler != null ? errorHandler : new ErrorPageErrorHandler());
        setProtectedTargets(__dftProtectedTargets);
    }
View Full Code Here

Examples of org.eclipse.jetty.servlet.ErrorPageErrorHandler

        }
        else
            code=Integer.valueOf(error);

        String location = node.getString("location", false, true);
        ErrorPageErrorHandler handler = (ErrorPageErrorHandler)context.getErrorHandler();
       
        switch (context.getMetaData().getOrigin("error."+error))
        {
            case NotSet:
            {
                //no error page setup for this code or exception yet
                if (code>0)
                    handler.addErrorPage(code,location);
                else
                    handler.addErrorPage(error,location);
                context.getMetaData().setOrigin("error."+error, descriptor);
                break;
            }
            case WebXml:
            case WebDefaults:
            case WebOverride:
            {
                //an error page setup was set in web.xml, only allow other web xml descriptors to override it
                if (!(descriptor instanceof FragmentDescriptor))
                {
                    if (descriptor instanceof OverrideDescriptor || descriptor instanceof DefaultsDescriptor)
                    {
                        if (code>0)
                            handler.addErrorPage(code,location);
                        else
                            handler.addErrorPage(error,location);
                        context.getMetaData().setOrigin("error."+error, descriptor);
                    }
                    else
                        throw new IllegalStateException("Duplicate global error-page "+location);
                }
                break;
            }
            case WebFragment:
            {
                //another web fragment set the same error code or exception, if its different its an error
                if (!handler.getErrorPages().get(error).equals(location))
                    throw new IllegalStateException("Conflicting error-code or exception-type "+error+" in "+descriptor.getResource());
                break;
            }
            default:
                LOG.warn(new Throwable()); // TODO throw ISE?
View Full Code Here

Examples of org.eclipse.jetty.servlet.ErrorPageErrorHandler

        }
        else
            code=Integer.valueOf(error);

        String location = node.getString("location", false, true);
        ErrorPageErrorHandler handler = (ErrorPageErrorHandler)context.getErrorHandler();
       
        switch (context.getMetaData().getOrigin("error."+error))
        {
            case NotSet:
            {
                //no error page setup for this code or exception yet
                if (code>0)
                    handler.addErrorPage(code,location);
                else
                    handler.addErrorPage(error,location);
                context.getMetaData().setOrigin("error."+error, descriptor);
                break;
            }
            case WebXml:
            case WebDefaults:
            case WebOverride:
            {
                //an error page setup was set in web.xml, only allow other web xml descriptors to override it
                if (!(descriptor instanceof FragmentDescriptor))
                {
                    if (descriptor instanceof OverrideDescriptor || descriptor instanceof DefaultsDescriptor)
                    {
                        if (code>0)
                            handler.addErrorPage(code,location);
                        else
                            handler.addErrorPage(error,location);
                        context.getMetaData().setOrigin("error."+error, descriptor);
                    }
                    else
                        throw new IllegalStateException("Duplicate global error-page "+location);
                }
                break;
            }
            case WebFragment:
            {
                //another web fragment set the same error code or exception, if its different its an error
                if (!handler.getErrorPages().get(error).equals(location))
                    throw new IllegalStateException("Conflicting error-code or exception-type "+error+" in "+descriptor.getResource());
                break;
            }
            default:
                LOG.warn(new Throwable()); // TODO throw ISE?
View Full Code Here

Examples of org.eclipse.jetty.servlet.ErrorPageErrorHandler

    }

    /* ------------------------------------------------------------ */
    public WebAppContext()
    {
        this(null,null,null,null,null,new ErrorPageErrorHandler(),SESSIONS|SECURITY);
    }
View Full Code Here

Examples of org.eclipse.jetty.servlet.ErrorPageErrorHandler

     * @param contextPath The context path
     * @param webApp The URL or filename of the webapp directory or war file.
     */
    public WebAppContext(String webApp,String contextPath)
    {
        this(null,contextPath,null,null,null,new ErrorPageErrorHandler(),SESSIONS|SECURITY);
        setWar(webApp);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.