QeelwaEtech / omnifaces

Automatically exported from code.google.com/p/omnifaces
0 stars 1 forks source link

UnmappedResourceHandler add missing methods createResource #153

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What OmniFaces version are you using? 1.4.1
What JSF impl/version are you using? Mojora 2.1.19
What servletcontainer impl/version are you using? Tomcat 7 (servlet 3.0)
If any, what JSF component library impl/version are you using? Use Icefaces 3.2 
EE 

All the methods createResource(...) must be ovverided. Indeed, if another 
ResourceHandlerWrapper delegate to a method createResource not overrided then 
the methode UnmappedResourceHandler.createResource() is never called. 

In UnmappedResourceHandler, you should adapt the code this way :

    @Override
    public Resource createResource(String resourceName) {
        return createResource(resourceName,null,null);

    }

    @Override
    public Resource createResource(String resourceName, String libraryName) {
        return createResource(resourceName, libraryName,null);
    }

   @Override
    public Resource createResource(final String resourceName, final String libraryName,String contentType) {
//same code as before in method createResource with 2 parameters
final Resource resource = super.createResource(resourceName, libraryName);
 if (resource == null) {
            return null;
        }

        return new ResourceWrapper() {...}
}

Original issue reported on code.google.com by jppu...@gmail.com on 15 Mar 2013 at 12:24

GoogleCodeExporter commented 9 years ago
Fixed: 
https://code.google.com/p/omnifaces/source/detail?r=e42f1a16fc79a0e6778a63075294
f403a3fa7e82

The attached snapshot contains the changes.

Original comment by balusc on 15 Mar 2013 at 8:40

Attachments: