This tutorial explains how to use annotations with spring 3 MVC and hibernate 3 based application to make the development easier and faster than ever before.
Spring 3 MVC and hibernate 3 example application using annotations
This tutorial explains how to use annotations with spring 3 MVC and hibernate 3 based application to make the development easier and faster than ever before. you can download also the application (including all jar files required), we are going to explain.
The application directory structure shoshould look like as below, if you are developing the application in eclipse.
Project Structure:
Jar files required:
Here is the list of jar files required for the application. (jar files are stored with the application download .)
Web. xml:
You must be aware of how spring is configured in Web. xml. Here is the Web. xml we configured for our application. All HTML requests are processed via spring.
<?XML Version="1.0" Encoding=UTF-8"?> <Web-app Version="2.5" Xmlns=Http://java.sun.com/xml/ns/javaee" Xmlns: xsi=Http://www.w3.org/2001/XMLSchema-instance" Xsi: schemalocation=Http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <Servlet> <Servlet-name>Dispatcher</Servlet-name> <Servlet-class>Org. springframework. Web. servlet. dispatcherservlet</Servlet-class> <Load-on-startup>1</Load-on-startup> </Servlet> <Servlet-Mapping> <Servlet-name>Dispatcher</Servlet-name> <URL-Pattern>*. Html</URL-Pattern> </Servlet-Mapping> <Welcome-file-list> <Welcome-File>Index.html</Welcome-File> </Welcome-file-list> </Web-app> |