Here are the basic steps (broad overview) to create a CRUD (Create,Read,Update,Delete) Web application using Spring, Hibernate and a DB Provider such as MySql. I’ll make another future post to outline the details.
1. Using Eclipse (Juno is the latest as of this post), setup a Dynamic Web Project and convert it to maven project.
2. Add the dependencies : be sure to clean install in maven to put your needed jars in the project so you won’t have library issues.
3. Setup the Database (connection, url)
4. create model class – add JPA annotations.
5. Create DAO components – @ Repository.
6. Add Service Components – @ Service.
7. Create Controller component – @Controller
– be sure to put BindingResult immediately after @ModelAttribute to avoid issues.
8. Create the View components – JSPs.
9. Configurations
– jdbc.properties.
-spring-servlet.xml
-log4j.xml
-hibernate.cfg.xml
-finally web.xml
10. Setup a web container (JBoss, Tomcat, Websphere) , clean compile and deploy!