Package javax.faces.application

Examples of javax.faces.application.ResourceHandler


                (MessageUtils.NULL_PARAMETERS_ERROR_MESSAGE_ID, "base and property"); // ?????
            throw new PropertyNotFoundException(message);
        }
        Object ret = null;
        if (base instanceof ResourceHandler) {
            ResourceHandler handler = (ResourceHandler) base;
            String prop = property.toString();
            Resource res;
            if (!prop.contains(":")) {
                res = handler.createResource(prop);
            } else {
                if (!isPropertyValid(prop)) {
                    // RELEASE_PENDING i18n
                    throw new ELException("Invalid resource format.  Property " + prop + " contains more than one colon (:)");
                }
                String[] parts = Util.split(prop, ":");
               
                // If the enclosing entity for this expression is itself
                // a resource, the "this" syntax for the library name must
                // be supported.
                if (null != parts[0] && parts[0].equals("this")) {
                    FacesContext facesContext = FacesContext.getCurrentInstance();
                    UIComponent currentComponent = UIComponent.getCurrentCompositeComponent(facesContext);
                    Resource componentResource = (Resource)
                                currentComponent.getAttributes().get(Resource.COMPONENT_RESOURCE_KEY);
                    if (null != componentResource) {
                        String libName = null;
                        if (null != (libName = componentResource.getLibraryName())) {
                            parts[0] = libName;
                        }
                    }
                   
                }
               
                res = handler.createResource(parts[1], parts[0]);
            }
            if (res != null) {
                ret = res.getRequestPath();
            }
            context.setPropertyResolved(true);
View Full Code Here


        FacesContext context = facesContextFactory.getFacesContext
              (servletConfig.getServletContext(), request, response, lifecycle);

        // Execute the request processing lifecycle for this request
        try {
            ResourceHandler handler =
                  context.getApplication().getResourceHandler();
            if (handler.isResourceRequest(context)) {
                handler.handleResourceRequest(context);
            } else {
                lifecycle.execute(context);
                lifecycle.render(context);
            }
        } catch (FacesException e) {
View Full Code Here

            // jsf 2.0 : get the current ResourceHandler and
            // check if it is a resource request, if true
            // delegate to ResourceHandler, if continue with
            // the lifecycle.
            // Acquire the ResourceHandler for this request by calling Application.getResourceHandler().
            ResourceHandler resourceHandler = facesContext.getApplication().getResourceHandler();

            // Call ResourceHandler.isResourceRequest(javax.faces.context.FacesContext).
            if (resourceHandler.isResourceRequest(facesContext))
            {
                // If this returns true call ResourceHandler.handleResourceRequest(javax.faces.context.FacesContext).
                resourceHandler.handleResourceRequest(facesContext);
            }
            else
            {
                // If this returns false, handle as follow
                // call Lifecycle.execute(javax.faces.context.FacesContext)
View Full Code Here

    public boolean containsNamespace(String ns)
    {
        if (ns != null && ns.startsWith(NAMESPACE_PREFIX))
        {
            ResourceHandler resourceHandler =
                FacesContext.getCurrentInstance().getApplication().getResourceHandler();
           
            if (ns.length() > NAMESPACE_PREFIX.length())
            {
                String libraryName = ns.substring(NAMESPACE_PREFIX.length());
                return resourceHandler.libraryExists(libraryName);
            }
        }       
        return false;
    }
View Full Code Here

    public boolean containsTagHandler(String ns, String localName)
    {
        if (ns != null && ns.startsWith(NAMESPACE_PREFIX))
        {
            ResourceHandler resourceHandler =
                FacesContext.getCurrentInstance().getApplication().getResourceHandler();
           
            if (ns.length() > NAMESPACE_PREFIX.length())
            {
                String libraryName = ns.substring(NAMESPACE_PREFIX.length());
                String resourceName = localName + ".xhtml";
                Resource compositeComponentResource = resourceHandler.createResource(resourceName, libraryName);
                if (compositeComponentResource != null)
                {
                    URL url = compositeComponentResource.getURL();
                    return (url != null);
                }
View Full Code Here

    public TagHandler createTagHandler(String ns, String localName,
            TagConfig tag) throws FacesException
    {
        if (ns != null && ns.startsWith(NAMESPACE_PREFIX))
        {
            ResourceHandler resourceHandler =
                FacesContext.getCurrentInstance().getApplication().getResourceHandler();
           
            if (ns.length() > NAMESPACE_PREFIX.length())
            {
                String libraryName = ns.substring(NAMESPACE_PREFIX.length());
                String resourceName = localName + ".xhtml";
                Resource compositeComponentResource = new CompositeResouceWrapper(
                    resourceHandler.createResource(resourceName, libraryName));
                if (compositeComponentResource != null)
                {
                    ComponentConfig componentConfig = new ComponentConfigWrapper(tag,
                            "javax.faces.NamingContainer", null);
                   
View Full Code Here

        {
            boolean result = super.containsTagHandler(ns, localName);
           
            if (!result && _compositeLibraryName != null)
            {
                ResourceHandler resourceHandler =
                    FacesContext.getCurrentInstance().getApplication().getResourceHandler();

                Resource compositeComponentResource = resourceHandler.createResource(
                        localName +".xhtml", _compositeLibraryName);
               
                if (compositeComponentResource != null)
                {
                    URL url = compositeComponentResource.getURL();
View Full Code Here

        {
            TagHandler tagHandler = super.createTagHandler(ns, localName, tag);
           
            if (tagHandler == null && containsNamespace(ns) && _compositeLibraryName != null)
            {
                ResourceHandler resourceHandler =
                    FacesContext.getCurrentInstance().getApplication().getResourceHandler();

                String resourceName = localName + ".xhtml";
                Resource compositeComponentResource = new CompositeResouceWrapper(
                    resourceHandler.createResource(resourceName, _compositeLibraryName));
               
                if (compositeComponentResource != null)
                {
                    ComponentConfig componentConfig = new ComponentConfigWrapper(tag,
                            "javax.faces.NamingContainer", null);
View Full Code Here

    public boolean containsNamespace(String ns)
    {
        if (ns != null && ns.startsWith(NAMESPACE_PREFIX))
        {
            ResourceHandler resourceHandler =
                FacesContext.getCurrentInstance().getApplication().getResourceHandler();
           
            if (ns.length() > NAMESPACE_PREFIX.length())
            {
                String libraryName = ns.substring(NAMESPACE_PREFIX.length());
                return resourceHandler.libraryExists(libraryName);
            }
        }       
        return false;
    }
View Full Code Here

    public boolean containsTagHandler(String ns, String localName)
    {
        if (ns != null && ns.startsWith(NAMESPACE_PREFIX))
        {
            ResourceHandler resourceHandler =
                FacesContext.getCurrentInstance().getApplication().getResourceHandler();
           
            if (ns.length() > NAMESPACE_PREFIX.length())
            {
                String libraryName = ns.substring(NAMESPACE_PREFIX.length());
                String resourceName = localName + ".xhtml";
                Resource compositeComponentResource = resourceHandler.createResource(resourceName, libraryName);
                if (compositeComponentResource != null)
                {
                    URL url = compositeComponentResource.getURL();
                    return (url != null);
                }
View Full Code Here

TOP

Related Classes of javax.faces.application.ResourceHandler

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.