Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between WEB-INF and /src/main/resources folders?

Which files "specifically" need to be in WEB-INF in a Spring 3 application which uses hibernate? I am also using Maven.

Do certain files in /src/main/resources need to be copied to WEB-INF before the app is run in a production environment?

Thanks!

like image 733
Sam Levin Avatar asked Jun 29 '12 00:06

Sam Levin


1 Answers

In your case, WEB-INF should contain a Web Descriptor web.xml and Spring configuration file(s). While the Hibernate configuration file hibernate.cfg.xml and other mapping files should put inside src/main/resources when development.

http://docs.jboss.org/hibernate/orm/4.1/manual/en-US/html/ch01.html#tutorial-firstapp

This official tutorial from Hibernate tells you some details in what to include in src/main/resources and WEB-INF which may help you to understand the structure.

http://viralpatel.net/blogs/spring3-mvc-hibernate-maven-tutorial-eclipse-example/

Also I found this tutorial quite similar to your case and you may have a reference on it.

DISCLAIMER: I do not own any of the web tutorial resources.

like image 154
Victor Wong Avatar answered Sep 28 '22 05:09

Victor Wong