Take the 2-minute tour ×

I am learning Spring 3.x MVC. I now have a regular web page setup with built in css in the html.

My first question - where should I store external css files and link them with the html files and still keep the L18n option available in the future? Should I keep the css in the WEB-INF/resources/css and make the resource directly available? But would it eliminate the L18n option?

My second question - to query a database, I have a query template XML file. I need to load the template into my model and modify a few keywords and send it through the database api. First thing that came to my mind is to put the keywords into something like ${keywords} in the template (like how the views are resolved), but I am not sure where to store the XML file (in the classpath? or in the web-inf?)? and how to set the variable in the template XML from my model?



share|improve this question

1 Answer 1

up vote 1 down vote accepted

It seem like you have two separate questions here.

In regards to CSS location, I'd recommend to try out Spring Roo tool. You can quickly generate a working web application with l18n support and number of other advanced features. This application could serve as a foundation for your own app or you can study its structure to learn many good practices for building Spring web applications.

In regards to your second question it is unclear what you want to substitute and at what time (i.e. deployment time or runtime) and also unclear what SQL templates you are using. I'd recommend to use iBatis/MyBatis framework, which has great integration with Spring and advanced templating support. There you can load your Spring contexts and template xmls from the Java application classpath.

share|improve this answer
Thanks Eugene - I'll take a look of the Roo tool. Re: second question, it wasn't SQL, it is proprietary query language. The substitution happens at runtime. I'll also take a look of the MyBatis. Thanks for pointing out those resources. –  Jason Mar 14 '12 at 18:11

Your Answer


