[ https://issues.apache.org/jira/browse/WICKET-3303?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Attila Király updated WICKET-3303: ---------------------------------- Attachment: WICKET-3303.patch Attaching a small, proof-of-concept patch that implements this support in the current trunk. All tests pass and works under both Servlet 2.5 and 3.0. Usages are not included in the patch but a typical one would look like this (that's how I tested it): - moved all yui lib static stuff from "/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui" folder to "/wicket-datetime/src/main/resources/META-INF/resources/org/apache/wicket/extensions/yui" folder. - updated YuiLib.java to use the new ResourceReference: YUILOADER = new MetaInfStaticResourceReference(YuiLib.class, sb.toString()); And thats it. > Use "META-INF/resources" (when available) to serve static resources > ------------------------------------------------------------------- > > Key: WICKET-3303 > URL: https://issues.apache.org/jira/browse/WICKET-3303 > Project: Wicket > Issue Type: Improvement > Components: wicket > Affects Versions: 1.5-M3 > Reporter: Attila Király > Attachments: WICKET-3303.patch > > > Servlet 3.0 introduced a new feature: files placed under the > "META-INF/resources" folder inside of a jar in the "/WEB-INF/lib" folder are > served by the container in the same way as other static files. I made a speed > test and it showed that Tomcat 7.0.5 serves files from this location 2-3 > times faster than wicket with its own method. > So it could be beneficial for wicket if it supported this when running on a > Servlet 3.0 engine. I think this should be made in wicket itself (and not as > an external module) because so wicket could use it too and implementing it > could need some specific hooks. > An implementation could roughly include the followings: > - a new ResourceReference subtype so users can choose to use this type of > resource handling for their bundled static files > - logic that generates different urls for the new ResourceReference subtype > based on if it is running on Servlet 3.0 engine (no need for > "wicket/resource/" prefix, example url: > "org/apache/wicket/extensions/yui/yuiloader/yuiloader-min.js") or it is > running on older engines (url would be the same as now: > "wicket/resource/org.apache.wicket.extensions.yui.YuiLib/yuiloader/yuiloader-min.js") > - logic that finds the resource even if it is on the "META-INF/resources/" > prefixed classpath. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.