PDA

View Full Version : Manage HTML resources in Spring MVC



abhisheks
May 21st, 2012, 08:10 PM
Is there any way to manage html resources in spring mvc ?
similar to grails-resources.
Link to grails resource : http://www.anyware.co.uk/2005/2011/09/12/optimising-your-application-with-grails-resources-plugin/

manish.in.java
May 21st, 2012, 10:32 PM
Do you mean keeping (X)HTML files in the web application and bypassing the MVC view resolver for these files? If yes, and using Spring 3.x, you can add



<mvc:resources location="/html/" mapping="/html/**" />


to your *-servlet.xml file. Then, all resources accessed with URLs starting with /html/ will be directly served and not be handled by the view resolvers.

abhisheks
May 22nd, 2012, 05:07 AM
No. I mean managing (js and css files).
How can i manage these files per page.
For example : i want script_1 and script_2 on page_1.jsp
i mention something like : LOAD_SCRIPT_1 which will loads script_1 and script_2

i define that somewere in spring and then load this command LOAD_SCRIPT_1 which will load the scripts.