Package org.apache.myfaces.shared_impl.webapp.webxml

Examples of org.apache.myfaces.shared_impl.webapp.webxml.WebXml


    private static ServletMapping getServletMapping(ExternalContext externalContext)
    {
        String servletPath = externalContext.getRequestServletPath();
        String requestPathInfo = externalContext.getRequestPathInfo();

        WebXml webxml = WebXml.getWebXml(externalContext);
        List mappings = webxml.getFacesServletMappings();


        if (requestPathInfo == null)
        {
            // might be extension mapping
View Full Code Here


        _context = context;
    }

    public WebXml parse()
    {
        _webXml = new WebXml();

        try
        {
            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            dbf.setIgnoringElementContentWhitespace(true);
View Full Code Here

    private static ServletMapping getServletMapping(ExternalContext externalContext)
    {
        String servletPath = externalContext.getRequestServletPath();
        String requestPathInfo = externalContext.getRequestPathInfo();

        WebXml webxml = WebXml.getWebXml(externalContext);
        List mappings = webxml.getFacesServletMappings();


        if (requestPathInfo == null)
        {
            // might be extension mapping
View Full Code Here

            // the ServletResponse.
            ExternalContext externalContext = new ServletExternalContextImpl(
                    servletContext, null, null);

            // Parse and validate the web.xml configuration file
            WebXml webXml = WebXml.getWebXml(externalContext);
            if (webXml == null) {
                if (log.isWarnEnabled()) {
                    log.warn("Couldn't find the web.xml configuration file. "
                            + "Abort initializing MyFaces.");
                }

                return;
            } else if (webXml.getFacesServletMappings().isEmpty()) {
                if (log.isWarnEnabled()) {
                    log.warn("No mappings of FacesServlet found. Abort initializing MyFaces.");
                }

                return;
View Full Code Here

    @Override
    public List<ServletMapping> getFacesServletMappings(
            ExternalContext externalContext)
    {
        WebXml webXml = WebXml.getWebXml(externalContext);
      
        List mapping = webXml.getFacesServletMappings();
    
        // In MyFaces 2.0, getFacesServletMappins is used only at startup
        // time, so we don't need to cache this result.
        List<ServletMapping> mappingList = new ArrayList<ServletMapping>(mapping.size());
       
View Full Code Here

            // the ServletResponse.
            ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
                //new ServletExternalContextImpl(servletContext, null, null);

            // Parse and validate the web.xml configuration file
            WebXml webXml = WebXml.getWebXml(externalContext);
            if (webXml == null) {
                if (log.isWarnEnabled()) {
                    log.warn("Couldn't find the web.xml configuration file. "
                            + "Abort initializing MyFaces.");
                }

                return;
            } else if (webXml.getFacesServletMappings().isEmpty()) {
                if (log.isWarnEnabled()) {
                    log.warn("No mappings of FacesServlet found. Abort initializing MyFaces.");
                }

                return;
View Full Code Here

       
        boolean errorPageWritten = false;
       
        // check if an error page is present in web.xml
        // if so, do not generate an error page
        WebXml webXml = WebXml.getWebXml(facesContext.getExternalContext());
        if (webXml.isErrorPagePresent())
        {
            // save current view in the request map to access it on the error page
            facesContext.getExternalContext().getRequestMap().put(VIEW_KEY, facesContext.getViewRoot());
        }
        else
View Full Code Here

            // use proper startup FacesContext and ExternalContext instances.
            FacesContext facesContext = FacesContext.getCurrentInstance();
            ExternalContext externalContext = facesContext.getExternalContext();

            // Parse and validate the web.xml configuration file
            WebXml webXml = WebXml.getWebXml(externalContext);
            if (webXml == null) {
                if (log.isLoggable(Level.WARNING)) {
                    log.warning("Couldn't find the web.xml configuration file. "
                             + "Abort initializing MyFaces.");
                }

                return;
            } else if (webXml.getFacesServletMappings().isEmpty()) {
                // check if the FacesServlet has been added dynamically
                // in a Servlet 3.0 environment by MyFacesContainerInitializer
                Boolean mappingAdded = (Boolean) servletContext.getAttribute(FACES_SERVLET_ADDED_ATTRIBUTE);
                if (mappingAdded == null || !mappingAdded)
                {
View Full Code Here

    public void destroyFaces(ServletContext servletContext) {
       
        FacesContext facesContext = FacesContext.getCurrentInstance();
       
        //We need to check if the current application was initialized by myfaces
        WebXml webXml = WebXml.getWebXml(facesContext.getExternalContext());
        if (webXml == null) {
            if (log.isLoggable(Level.WARNING)) {
                log.warning("Couldn't find the web.xml configuration file. "
                         + "Abort destroy MyFaces.");
            }

            return;
        } else if (webXml.getFacesServletMappings().isEmpty()) {
            // check if the FacesServlet has been added dynamically
            // in a Servlet 3.0 environment by MyFacesContainerInitializer
            Boolean mappingAdded = (Boolean) servletContext.getAttribute(FACES_SERVLET_ADDED_ATTRIBUTE);
            if (mappingAdded == null || !mappingAdded)
            {
View Full Code Here

            // use proper startup FacesContext and ExternalContext instances.
            FacesContext facesContext = FacesContext.getCurrentInstance();
            ExternalContext externalContext = facesContext.getExternalContext();

            // Parse and validate the web.xml configuration file
            WebXml webXml = WebXml.getWebXml(externalContext);
            if (webXml == null) {
                if (log.isLoggable(Level.WARNING)) {
                    log.warning("Couldn't find the web.xml configuration file. "
                             + "Abort initializing MyFaces.");
                }

                return;
            } else if (webXml.getFacesServletMappings().isEmpty()) {
                // check if the FacesServlet has been added dynamically
                // in a Servlet 3.0 environment by MyFacesContainerInitializer
                Boolean mappingAdded = (Boolean) servletContext.getAttribute(FACES_SERVLET_ADDED_ATTRIBUTE);
                if (mappingAdded == null || !mappingAdded)
                {
View Full Code Here

TOP

Related Classes of org.apache.myfaces.shared_impl.webapp.webxml.WebXml

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.