Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResourceDirectoryReference with shared resources #9

Open
GoogleCodeExporter opened this issue Jul 24, 2015 · 0 comments
Open

ResourceDirectoryReference with shared resources #9

GoogleCodeExporter opened this issue Jul 24, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

I have tried your ResourceDirectory and ResourceDirectoryReference classes. 
Maybe it works good for some resources that are hard coded in html template, 
but I am using wicket shared resources, for example

           ref = new PackageResourceReference(Resources.class, "awesomefont/css/font-awesome.min.css");

was registered in the DecoratingHeaderResponse :

            realResponse.render(CssHeaderItem.forReference(ref));

Because I have tons of such resources, therefore I tried to use your feature to 
mount whole awesomefont directory:

        mountResource("resources/awesomefont", new ResourceDirectoryReference(new File("/com/........../portal/pages")));


And got FileNotFoundException because wicket adds a version to every properly 
handled resource:


org.apache.wicket.util.resource.ResourceStreamNotFoundException: Resource 
/com/...../portal/pages/resources/awesomefont/css/font-awesome.min-ver-7FBE76CDA
C6093784895BB4989203E5A.css could not be found
    at org.apache.wicket.util.resource.FileResourceStream.getInputStream(FileResourceStream.java:124) ~[wicket-util-6.15.0.jar:6.15.0]
    at com..........portal.pages.resources.ResourceDirectory.newResourceResponse(ResourceDirectory.java:133) ~[classes/:na]
    at org.apache.wicket.request.resource.AbstractResource.respond(AbstractResource.java:498) [wicket-core-6.15.0.jar:6.15.0]
    at org.apache.wicket.request.handler.resource.ResourceRequestHandler.respond(ResourceRequestHandler.java:75) [wicket-core-6.15.0.jar:6.15.0]
    at org.apache.wicket.request.handler.resource.ResourceReferenceRequestHandler.respond(ResourceReferenceRequestHandler.java:108) [wicket-core-6.15.0.jar:6.15.0]
    at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:862) [wicket-core-6.15.0.jar:6.15.0]
Caused by: java.io.FileNotFoundException: 
/com/......./portal/pages/resources/awesomefont/css/font-awesome.min-ver-7FBE76C
DAC6093784895BB4989203E5A.css (No such file or directory)
    at java.io.FileInputStream.open(Native Method) ~[na:1.7.0_55]
    at java.io.FileInputStream.<init>(FileInputStream.java:146) ~[na:1.7.0_55]
    at org.apache.wicket.util.resource.FileResourceStream.getInputStream(FileResourceStream.java:120) ~[wicket-util-6.15.0.jar:6.15.0]


As you see, the problem is that it tries to locate a wrong file with generated 
version: 
font-awesome.min-ver-7FBE76CDAC6093784895BB4989203E5A.css

Correct one would be font-awesome.min.css

You have some great features, I hope sometime your will release them!

Good luck,

Michael


Original issue reported on code.google.com by [email protected] on 31 Jul 2014 at 1:07

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant