Tutorial:Create Spring 3 MVC Hibernate 3 Example using Maven in Eclipse

Let us make a complete end-to-end application using Spring 3.0 MVC as front end technology and Hibernate as backend ORM technology. For this application we will also use Maven for build and dependency management and MySQL as database to persist the data.

The application will be a simple Contact Manager app which will allow user to add new contacts. The list of contacts will be displayed and user will be able to delete existing contacts.

Our Goal

As describe above, our goal is to create a contact manager application which will allow the user to add a contact or remove it. The basic requirement of the Contact Manager app will be:

  1. Add new contact in the contact list.
  2. Display all contacts from contact list.
  3. Delete a contact from contact list.

Following is the screenshot of end application.
spring3-hibernate-contact-manager

Application Architecture

We will have a layered architecture for our demo application. The database will be accessed by a Data Access layer popularly called as DAO Layer. This layer will use Hibernate API to interact with database. The DAO layer will be invoked by a service layer. In our application we will have a Service interface called ContactService.
spring3-hibernate-application-architecture

Getting Started

For our Contact Manager example, we will use MySQL database. Create a table contacts in any MySQL database. This is very preliminary example and thus we have minimum columns to represent a contact. Feel free to extend this example and create a more complex application.

CREATE TABLE CONTACTS
(
    id              INT PRIMARY KEY AUTO_INCREMENT,
    firstname    VARCHAR(30),
    lastname    VARCHAR(30),
    telephone   VARCHAR(15),
    email         VARCHAR(30),
    created     TIMESTAMP DEFAULT NOW()
);

Creating Project in Eclipse

The contact manager application will use Maven for build and dependency management. For this we will use the Maven Dynamic Web Project in Eclipse as the base architecture of our application.

Download the below source code:
Maven Dynamic Web Project (6.7 KB)

spring3-hibernate-project-structureUnzip the source code to your hard drive and import the project in Eclipse. Once the project is imported in Eclipse, we will create package structure for Java source. Create following packages under src/main/java folder.

  • net.viralpatel.contact.controller – This package will contain Spring Controller classes for Contact Manager application.
  • net.viralpatel.contact.form – This package will contain form object for Contact manager application. Contact form will be a simple POJO class with different attributes such as firstname, lastname etc.
  • net.viralpatel.contact.service – This package will contain code for service layer for our Contact manager application. The service layer will have one ContactService interface and its corresponding implementation class
  • net.viralpatel.contact.dao – This is the DAO layer of Contact manager application. It consists of ContactDAO interface and its corresponding implementation class. The DAO layer will use Hibernate API to interact with database.

Entity Class – The Hibernate domain class

Let us start with the coding of Contact manager application. First we will create a form object or hibernate POJO class to store contact information. Also this class will be an Entity class and will be linked with CONTACTS table in database.
Create a java class Contact.java under net.viralpatel.contact.form package and copy following code into it.

File: src/main/java/net/viralpatel/contact/form/Contact.java

package net.viralpatel.contact.form;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name="CONTACTS")
public class Contact {
    
    @Id
    @Column(name="ID")
    @GeneratedValue
    private Integer id;
    
    @Column(name="FIRSTNAME")
    private String firstname;

    @Column(name="LASTNAME")
    private String lastname;

    @Column(name="EMAIL")
    private String email;
    
    @Column(name="TELEPHONE")
    private String telephone;
    
    
    public String getEmail() {
        return email;
    }
    public String getTelephone() {
        return telephone;
    }
    public void setEmail(String email) {
        this.email = email;
    }
    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }
    public String getFirstname() {
        return firstname;
    }
    public String getLastname() {
        return lastname;
    }
    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }
    public void setLastname(String lastname) {
        this.lastname = lastname;
    }
    public Integer getId() {
        return id;
    }
    public void setId(Integer id) {
        this.id = id;
    }
}

The first thing you’ll notice is that the import statements import from javax.persistence rather than a Hibernate or Spring package. Using Hibernate with Spring, the standard JPA annotations work just as well and that’s what I’m using here.

  • First we’ve annotated the class with @Entity which tells Hibernate that this class represents an object that we can persist.
  • The @Table(name = "CONTACTS") annotation tells Hibernate which table to map properties in this class to. The first property in this class on line 16 is our object ID which will be unique for all events persisted. This is why we’ve annotated it with @Id.
  • The @GeneratedValue annotation says that this value will be determined by the datasource, not by the code.
  • The @Column(name = "FIRSTNAME") annotation is used to map this property to the FIRSTNAME column in the CONTACTS table.

The Data Access (DAO) Layer

The DAO layer of Contact Manager application consist of an interface ContactDAO and its corresponding implementation class ContactDAOImpl. Create following Java files in net.viralpatel.contact.dao package.

File: src/main/java/net/viralpatel/contact/dao/ContactDAO.java

package net.viralpatel.contact.dao;

import java.util.List;

import net.viralpatel.contact.form.Contact;

public interface ContactDAO {
    
    public void addContact(Contact contact);
    public List<Contact> listContact();
    public void removeContact(Integer id);
}

File: src/main/java/net/viralpatel/contact/dao/ContactDAOImpl.java

package net.viralpatel.contact.dao;

import java.util.List;

import net.viralpatel.contact.form.Contact;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class ContactDAOImpl implements ContactDAO {

    @Autowired
    private SessionFactory sessionFactory;

    public void addContact(Contact contact) {
        sessionFactory.getCurrentSession().save(contact);
    }

    public List<Contact> listContact() {

        return sessionFactory.getCurrentSession().createQuery("from Contact")
                .list();
    }

    public void removeContact(Integer id) {
        Contact contact = (Contact) sessionFactory.getCurrentSession().load(
                Contact.class, id);
        if (null != contact) {
            sessionFactory.getCurrentSession().delete(contact);
        }

    }
}

The DAO class in above code ContactDAOImpl implements the data access interface ContactDAO which defines methods such as listContact(), addContact() etc to access data from database.

Note that we have used two Spring annotations @Repository and @Autowired.

Classes marked with annotations are candidates for auto-detection by Spring when using annotation-based configuration and classpath scanning. The @Component annotation is the main stereotype that indicates that an annotated class is a “component”.

The @Repository annotation is yet another stereotype that was introduced in Spring 2.0. This annotation is used to indicate that a class functions as a repository and needs to have exception translation applied transparently on it. The benefit of exception translation is that the service layer only has to deal with exceptions from Spring’s DataAccessException hierarchy, even when using plain JPA in the DAO classes.

Another annotation used in ContactDAOImpl is @Autowired. This is used to autowire the dependency of the ContactDAOImpl on the SessionFactory.

The Service Layer

The Service layer of Contact Manager application consist of an interface ContactService and its corresponding implementation class ContactServiceImpl. Create following Java files in net.viralpatel.contact.service package.

File: src/main/java/net/viralpatel/contact/service/ContactService.java

package net.viralpatel.contact.service;

import java.util.List;

import net.viralpatel.contact.form.Contact;

public interface ContactService {
    
    public void addContact(Contact contact);
    public List<Contact> listContact();
    public void removeContact(Integer id);
}

File: src/main/java/net/viralpatel/contact/service/ContactServiceImpl.java

package net.viralpatel.contact.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import net.viralpatel.contact.dao.ContactDAO;
import net.viralpatel.contact.form.Contact;

@Service
public class ContactServiceImpl implements ContactService {

    @Autowired
    private ContactDAO contactDAO;
    
    @Transactional
    public void addContact(Contact contact) {
        contactDAO.addContact(contact);
    }

    @Transactional
    public List<Contact> listContact() {

        return contactDAO.listContact();
    }

    @Transactional
    public void removeContact(Integer id) {
        contactDAO.removeContact(id);
    }
}

In above service layer code, we have created an interface ContactService and implemented it in class ContactServiceImpl. Note that we used few Spring annotations such as @Service, @Autowired and @Transactional in our code. These annotations are called Spring stereotype annotations.

The @Service stereotype annotation used to decorate the ContactServiceImpl class is a specialized form of the @Component annotation. It is appropriate to annotate the service-layer classes with @Service to facilitate processing by tools or anticipating any future service-specific capabilities that may be added to this annotation.

Adding Spring MVC Support

Let us add Spring MVC support to our web application.

Update the web.xml file and add servlet mapping for org.springframework.web.servlet.DispatcherServlet. Also note that we have mapped url / with springServlet so all the request are handled by spring.

File: /src/webapp/WEB-INF/web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="http://java.sun.com/xml/ns/javaee"
	xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	id="WebApp_ID" version="2.5">
	<display-name>Spring3-Hibernate</display-name>
	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
	</welcome-file-list>
	<servlet>
		<servlet-name>spring</servlet-name>
		<servlet-class>
			org.springframework.web.servlet.DispatcherServlet
		</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>
	<servlet-mapping>
		<servlet-name>spring</servlet-name>
		<url-pattern>/</url-pattern>
	</servlet-mapping>
</web-app>

Once the web.xml is configured, let us add spring-servlet.xml and jdbc.properties files in /src/main/webapp/WEB-INF folder.
File: /src/main/webapp/WEB-INF/jdbc.properties

jdbc.driverClassName= com.mysql.jdbc.Driver
jdbc.dialect=org.hibernate.dialect.MySQLDialect
jdbc.databaseurl=jdbc:mysql://localhost:3306/ContactManager
jdbc.username=root
jdbc.password=testpass

The jdbc.properties file contains database connection information such as database url, username, password, driver class. You may want to edit the driverclass and dialect to other DB if you are not using MySQL.

Oracle Properties

In case you are using Oracle database, you can modify the jdbc properties and have oracle related dialect and other properties:

jdbc.driverClassName=oracle.jdbc.driver.OracleDriver
jdbc.dialect=org.hibernate.dialect.OracleDialect
jdbc.databaseurl=jdbc:oracle:thin:@127.0.0.1:1525:CustomerDB
jdbc.username=scott
jdbc.password=tiger

File: /src/main/webapp/WEB-INF/spring-servlet.xml

<?xml  version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:aop="http://www.springframework.org/schema/aop"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:jee="http://www.springframework.org/schema/jee"
	xmlns:lang="http://www.springframework.org/schema/lang"
	xmlns:p="http://www.springframework.org/schema/p"
	xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:util="http://www.springframework.org/schema/util"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
		http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd
		http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd
		http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">

	<context:annotation-config />
	<context:component-scan base-package="net.viralpatel.contact" />

	<bean id="jspViewResolver"
		class="org.springframework.web.servlet.view.InternalResourceViewResolver">
		<property name="viewClass"
			value="org.springframework.web.servlet.view.JstlView" />
		<property name="prefix" value="/WEB-INF/jsp/" />
		<property name="suffix" value=".jsp" />
	</bean>

	<bean id="messageSource"
		class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
		<property name="basename" value="classpath:messages" />
		<property name="defaultEncoding" value="UTF-8" />
	</bean>
	<bean id="propertyConfigurer"
		class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
		p:location="/WEB-INF/jdbc.properties" />

	<bean id="dataSource"
		class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"
		p:driverClassName="${jdbc.driverClassName}"
		p:url="${jdbc.databaseurl}" p:username="${jdbc.username}"
		p:password="${jdbc.password}" />


	<bean id="sessionFactory"
		class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
		<property name="dataSource" ref="dataSource" />
		<property name="configLocation">
			<value>classpath:hibernate.cfg.xml</value>
		</property>
		<property name="configurationClass">
			<value>org.hibernate.cfg.AnnotationConfiguration</value>
		</property>
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.dialect">${jdbc.dialect}</prop>
				<prop key="hibernate.show_sql">true</prop>
			</props>
		</property>
	</bean>

	<tx:annotation-driven />
	<bean id="transactionManager"
		class="org.springframework.orm.hibernate3.HibernateTransactionManager">
		<property name="sessionFactory" ref="sessionFactory" />
	</bean>
</beans>

The spring-servlet.xml file contains different spring mappings such as transaction manager, hibernate session factory bean, data source etc.

  • jspViewResolver bean – This bean defined view resolver for spring mvc. For this bean we also set prefix as “/WEB-INF/jsp/” and suffix as “.jsp”. Thus spring automatically resolves the JSP from WEB-INF/jsp folder and assigned suffix .jsp to it.
  • messageSource bean – To provide Internationalization to our demo application, we defined bundle resource property file called messages.properties in classpath.
    Related: Internationalization in Spring MVC
  • propertyConfigurer bean – This bean is used to load database property file jdbc.properties. The database connection details are stored in this file which is used in hibernate connection settings.
  • dataSource bean – This is the java datasource used to connect to contact manager database. We provide jdbc driver class, username, password etc in configuration.
  • sessionFactory bean – This is Hibernate configuration where we define different hibernate settings. hibernate.cfg.xml is set a config file which contains entity class mappings
  • transactionManager bean – We use hibernate transaction manager to manage the transactions of our contact manager application.

File: /src/main/resources/hibernate.cfg.xml

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
    "-//Hibernate/Hibernate Configuration DTD//EN"
    "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
    <session-factory>
        <mapping class="net.viralpatel.contact.form.Contact" />
    </session-factory>
	    
</hibernate-configuration>

File: /src/main/resources/messages_en.properties

label.firstname=First Name
label.lastname=Last Name
label.email=Email
label.telephone=Telephone
label.addcontact=Add Contact

label.menu=Menu
label.title=Contact Manager
label.footer=&copy; ViralPatel.net

Spring MVC Controller

We are almost done with our application. Just add following Spring controller class ContactController.java to net.viralpatel.contact.controller package.

File: /src/main/java/net/viralpatel/contact/controller/ContactController.java

package net.viralpatel.contact.controller;

import java.util.Map;

import net.viralpatel.contact.form.Contact;
import net.viralpatel.contact.service.ContactService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
public class ContactController {

	@Autowired
	private ContactService contactService;

	@RequestMapping("/index")
	public String listContacts(Map<String, Object> map) {

		map.put("contact", new Contact());
		map.put("contactList", contactService.listContact());

		return "contact";
	}

	@RequestMapping(value = "/add", method = RequestMethod.POST)
	public String addContact(@ModelAttribute("contact")
	Contact contact, BindingResult result) {

		contactService.addContact(contact);

		return "redirect:/index";
	}

	@RequestMapping("/delete/{contactId}")
	public String deleteContact(@PathVariable("contactId")
	Integer contactId) {

		contactService.removeContact(contactId);

		return "redirect:/index";
	}
}

The spring controller defines three methods to manipulate contact manager application.

  • listContacts method – This method uses Service interface ContactServer to fetch all the contact details in our application. It returns an array of contacts. Note that we have mapped request “/index” to this method. Thus Spring will automatically calls this method whenever it encounters this url in request.
  • addContact method – This method adds a new contact to contact list. The contact details are fetched in Contact object using @ModelAttribute annotation. Also note that the request “/add” is mapped with this method. The request method should also be POST. Once the contact is added in contact list using ContactService, we redirect to /index page which in turn calls listContacts() method to display contact list to user.
    Related: Forms in Spring MVC
  • deleteContact method – This methods removes a contact from the contact list. Similar to addContact this method also redirects user to /index page once the contact is removed. One this to note in this method is the way we have mapped request url using @RequestMapping annotation. The url “/delete/{contactId}” is mapped thus whenever user send a request /delete/12, the deleteCotact method will try to delete contact with ID:12.

Finally add following JSP file to WEB-INF/jsp folder.

File: /src/main/webapp/WEB-INF/jsp/contact.jsp

<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
	<title>Spring 3 MVC Series - Contact Manager | viralpatel.net</title>
</head>
<body>

<h2>Contact Manager</h2>

<form:form method="post" action="add.html" commandName="contact">

	<table>
	<tr>
		<td><form:label path="firstname"><spring:message code="label.firstname"/></form:label></td>
		<td><form:input path="firstname" /></td> 
	</tr>
	<tr>
		<td><form:label path="lastname"><spring:message code="label.lastname"/></form:label></td>
		<td><form:input path="lastname" /></td>
	</tr>
	<tr>
		<td><form:label path="email"><spring:message code="label.email"/></form:label></td>
		<td><form:input path="email" /></td>
	</tr>
	<tr>
		<td><form:label path="telephone"><spring:message code="label.telephone"/></form:label></td>
		<td><form:input path="telephone" /></td>
	</tr>
	<tr>
		<td colspan="2">
			<input type="submit" value="<spring:message code="label.addcontact"/>"/>
		</td>
	</tr>
</table>	
</form:form>

	
<h3>Contacts</h3>
<c:if  test="${!empty contactList}">
<table class="data">
<tr>
	<th>Name</th>
	<th>Email</th>
	<th>Telephone</th>
	<th>&nbsp;</th>
</tr>
<c:forEach items="${contactList}" var="contact">
	<tr>
		<td>${contact.lastname}, ${contact.firstname} </td>
		<td>${contact.email}</td>
		<td>${contact.telephone}</td>
		<td><a href="delete/${contact.id}">delete</a></td>
	</tr>
</c:forEach>
</table>
</c:if>

</body>
</html>

Download Source code

Spring3MVC_Hibernate_Maven.zip (16 KB)

That’s All folks

Compile and execute the Contact manager application in Eclipse.
spring3-hibernate-contact-manager

If you read this far, you should follow me on twitter here.



384 Comments

  • Manisha Sarangi 8 April, 2013, 15:24

    in web.xml,I write EC.jsp instead of writing add.html
    EC.jsp

       <%@taglib uri="http://www.springframework.org/tags&quot; prefix="spring"%>
    <%@taglib uri="http://www.springframework.org/tags/form&quot; prefix="form"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core&quot; prefix="c"%>
    <html>
    <head>
        <title>Spring 3 MVC Series - Contact Manager | viralpatel.net</title>
    </head>
    <body>
     
    <h2>Contact Manager</h2>
     
    <form:form method="post" action="add.html" commandName="ec">
     
        <table>
        <tr>
            <td><form:label path="EC_Date"><spring:message code="label.EC_Date"/></form:label></td>
            <td><form:input path="EC_Date" /></td> 
        </tr>
        <tr>
            <td><form:label path="EC_Time"><spring:message code="label.EC_Time"/></form:label></td>
            <td><form:input path="EC_Time" /></td>
        </tr>
        <tr>
            <td><form:label path="EC_enumerator"><spring:message code="label.EC_enumerator"/></form:label></td>
            <td><form:input path="EC_enumerator" /></td>
        </tr>
        <tr>
            <td><form:label path="EC_Q_1"><spring:message code="label.EC_Q_1"/></form:label></td>
            <td><form:input path="EC_Q_1" /></td>
        </tr>
        
        <tr>
            <td><form:label path="EC_Q_3"><spring:message code="label.EC_Q_3"/></form:label></td>
            <td><form:input path="EC_Q_3" /></td>
        </tr>
        <tr>
            <td><form:label path="EC_Q_4"><spring:message code="label.EC_Q_4"/></form:label></td>
            <td><form:input path="EC_Q_4" /></td>
        </tr>
        <tr>
            <td><form:label path="EC_municipality"><spring:message code="label.EC_municipality"/></form:label></td>
            <td><form:input path="EC_municipality" /></td>
        </tr>
          <tr>
            <td><form:label path="EC_Total_male"><spring:message code="label.EC_Total_male"/></form:label></td>
            <td><form:input path="EC_Total_male" /></td>
        </tr>
        
        <tr>
            <td><form:label path="EC_Total_female"><spring:message code="label.EC_Total_female"/></form:label></td>
            <td><form:input path="EC_Total_female" /></td>
        </tr>
        <tr>
            <td colspan="2">
                <input type="submit" value="<spring:message code="label.addEC"/>"/>
            </td>
        </tr>
    </table>  
    </form:form>
     
         
    <h3>EC</h3>
    <c:if  test="${!empty ecList}">
    <table class="data">
    <tr>
        <th>Date</th>
        <th>Time</th>
        <th></th>
        <th>&nbsp;</th>
    </tr>
    <c:forEach items="${ecList}" var="ec">
        <tr>
            <td>${ec.EC_Date}, ${ec.EC_Time} </td>
            <td>${ec.EC_enumerator}</td>
            <td>${ec. EC_Q_1}</td>
            <td><a href="delete/${ec.id}">delete</a></td>
        </tr>
    </c:forEach>
    </table>
    </c:if>
     
    </body>
    </html> 

    web.xml

     <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
        xmlns="http://java.sun.com/xml/ns/javaee&quot;
        xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&quot;
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&quot;
        id="WebApp_ID" version="2.5">
        <display-name>Spring3-Hibernate</display-name>
        <welcome-file-list>
            <welcome-file>EC.jsp</welcome-file>
        </welcome-file-list>
        <servlet>
            <servlet-name>spring</servlet-name>
            <servlet-class>
                org.springframework.web.servlet.DispatcherServlet
            </servlet-class>
            <load-on-startup>1</load-on-startup>
        </servlet>
        <servlet-mapping>
            <servlet-name>spring</servlet-name>
            <url-pattern>/</url-pattern>
            
        </servlet-mapping>
    </web-app> 

    I am getting REQUESTED RESOURCE NOT AVAILABLE error.pls suggest

  • Manisha Sarangi 8 April, 2013, 19:05

    hey in the contact.jsp,there is written action=add.html,but add.html is written nowhere.where Should I write this??

  • veeranna 9 April, 2013, 15:40
    Apr 9, 2013 3:34:37 PM org.apache.catalina.core.AprLifecycleListener init
    INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.6.0_32\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/bin/client;C:/Program Files/Java/bin;C:/Program Files/Java/lib/i386;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program 
    	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    	at java.lang.Thread.run(Thread.java:662)
    Caused by: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/servlet/ServletContextEvent
    	at java.lang.ClassLoader.defineClass1(Native Method)
    	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
    	at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
    Apr 9, 2013 3:34:39 PM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 773 ms
    
  • Jagruti 11 April, 2013, 21:16

    I need to know how should i configure this proj in eclipse and how to run this proj?

    • Announymous 28 May, 2013, 3:50

      Download the eclipse plugin m2e-wtp, when installed, eclipse restarted, right click on project and choose from the menu Configure -> Convert to maven project. Give it a few seconds and it will download necessary jars… Right click again on project and pick from menu “run on server” assuming u have tomcat installed and configured in eclipse. Also assumes u got mysql server installed, running and the created the table which is needed in this case. Hope it helps!

  • hemanth 22 April, 2013, 17:48

    i used u r code to learn spring but it showing exception in jar files even am having jars still it showing exception please try to help here and i didn’t follow the maven i copied all jars and pasted under web-inf/lib folder

    • hemanth 22 April, 2013, 17:49

      please find below the exception details:

      Apr 22, 2013 5:50:16 PM org.apache.catalina.core.AprLifecycleListener init
      INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program r.java:209)	 org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:638)
      	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:595)
      	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:652)
      	at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:514)
      	at java.lang.Thread.run(Unknown Source)
      Caused by: java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor
      	at java.lang.ClassLoader.defineClass1(Native Method)
      	at java.lang.ClassLoader.defineClassCond(Unknown Source)
      	at java.lang.ClassLoader.defineClass(Unknown Source)
      	at java.security.SecureClassLoader.defineClass(Unknown Source)
      
  • hemanth 23 April, 2013, 9:43

    it’s working fine…. actually annonation problem i fixed it thanks

    • Paweł 24 April, 2013, 2:13

      how did you fix that problem?

  • Anon 28 April, 2013, 10:01

    Man, it doesn’t work,include your project available to download ;(.

  • Basanta 1 May, 2013, 7:53

    Hello admin,
    What about list.html

    • Viral Patel 25 May, 2013, 19:16

      The list.html specified in web.xml was not correct. I changed it to index.html. Now index.html is mapped to listContacts using @RequestMapping("/index").

      • Kalaivani 10 June, 2013, 13:31

        you have mentioned index.html at the start of the web.xml but you dont have that page

  • Manoj Singh 2 May, 2013, 22:09

    I am using sping=3.2.2.RELEASE hibernate = 4.2.0.Final and getting exceptin at runtime

    SEVERE: Allocate exception for servlet spring
    java.lang.ClassCastException: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider cannot be cast to org.hibernate.service.jdbc.connections.spi.ConnectionProvider
    at org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator.instantiateExplicitConnectionProvider(ConnectionProviderInitiator.java:189)
    at org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator.initiateService(ConnectionProviderInitiator.java:114)
    at org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator.initiateService(ConnectionProviderInitiator.java:54)
    at org.hibernate.service.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:69)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:176)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:150)

  • Subham 5 May, 2013, 23:04

    type Exception report

    message An exception occurred processing JSP page /contact.jsp at line 36

    description The server encountered an internal error that prevented it from fulfilling this request.

    exception

    org.apache.jasper.JasperException: An exception occurred processing JSP page /contact.jsp at line 36

    33:
    34:
    35:
    36:
    37:
    38:
    39:

    Stacktrace:
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:465)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

    root cause

    java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name ‘contact’ available as request attribute
    org.springframework.web.servlet.support.BindStatus.(BindStatus.java:141)
    org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getBindStatus(AbstractDataBoundFormElementTag.java:174)
    org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getPropertyPath(AbstractDataBoundFormElementTag.java:194)
    org.springframework.web.servlet.tags.form.LabelTag.autogenerateFor(LabelTag.java:129)
    org.springframework.web.servlet.tags.form.LabelTag.resolveFor(LabelTag.java:119)
    org.springframework.web.servlet.tags.form.LabelTag.writeTagContent(LabelTag.java:89)
    org.springframework.web.servlet.tags.form.AbstractFormTag.doStartTagInternal(AbstractFormTag.java:102)
    org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:79)
    org.apache.jsp.contact_jsp._jspx_meth_form_005flabel_005f0(contact_jsp.java:261)
    org.apache.jsp.contact_jsp._jspx_meth_form_005fform_005f0(contact_jsp.java:172)
    org.apache.jsp.contact_jsp._jspService(contact_jsp.java:122)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

    My controller class-

    package org.subham.contact.controller;
    import java.util.List;
    import java.util.Map;

    import org.subham.contact.model.Contact;
    import org.subham.contact.service.ContactService;

    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.stereotype.Controller;
    import org.springframework.ui.Model;
    import org.springframework.validation.BindingResult;
    import org.springframework.web.bind.annotation.ModelAttribute;
    import org.springframework.web.bind.annotation.PathVariable;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RequestMethod;
    import org.springframework.web.servlet.ModelAndView;

    @Controller
    public class ContactController {
    @Autowired
    private ContactService contactService;

    @RequestMapping(“/SpringHibernateMaven1/index”)
    public String listContacts(Map map) {

    Contact contact=new Contact();
    map.put(“contact”, contact);
    map.put(“contactList”, contactService.listContact());

    return “contact”;
    }

    @RequestMapping(value = “/add”, method = RequestMethod.POST)
    public String addContact(@ModelAttribute(“contact”)Contact contact, BindingResult result) {

    contactService.addContact(contact);

    return “redirect:/index”;
    }

    @RequestMapping(“/delete/{contactId}”)
    public String deleteContact(@PathVariable(“contactId”)Integer contactId)
    {
    contactService.removeContact(contactId);
    return “redirect:/index”;
    }
    }

    I change only in web.xml

    index.jsp

    Others class and contact.jsp is same as example.
    Please help me.

  • Subham 8 May, 2013, 22:06

    Please help me about above problem.

  • raju rathi 11 May, 2013, 18:01

    what are the jar required to run this appliaction . I’m unable to downaod application . can you please publish pom.xml

  • prashansa kumari 12 May, 2013, 15:57

    it’s not working it’s giving an error

    HTTP Status 500 - 
    
    --------------------------------------------------------------------------------
    
    type Exception report
    
    message 
    
    description The server encountered an internal error () that prevented it from fulfilling this request.
    
    exception 
    
    javax.servlet.ServletException: Servlet.init() for servlet spring threw exception
    	org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
    	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
    	org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
    	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
    	org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
    	org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
    	org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166)
    	org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
    	java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    	java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    	java.lang.Thread.run(Unknown Source)
    
    
    root cause 
    
    java.lang.NoSuchMethodError: org.springframework.web.context.ConfigurableWebApplicationContext.setId(Ljava/lang/String;)V
    	org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:431)
    	org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:459)
    	org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:340)
    	org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)
    	org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
    	javax.servlet.GenericServlet.init(GenericServlet.java:160)
    	org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
    	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
    	org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
    	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
    	org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
    	org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
    	org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166)
    	org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
    	java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    	java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    	java.lang.Thread.run(Unknown Source)
    
    
    note The full stack trace of the root cause is available in the Apache Tomcat/7.0.12 logs.
    
    
  • K Chiranjeevi 13 May, 2013, 15:19

    HI Frd,

    I am getting below.Kindly help me somebody….

    SEVERE: StandardWrapper.Throwable
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contactServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private net.viralpatel.contact.dao.ContactDAO net.viralpatel.contact.service.ContactServiceImpl.contactDAO; nested exception is org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:626)
    	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
    	at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:651)
    	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    	at java.lang.Thread.run(Thread.java:679)
    
  • bobby 15 May, 2013, 8:42

    Add the dependency:

    javax.persistence
    persistence-api
    1.0

    and change hibernate-dependencies to hibernate-core

  • bobby 15 May, 2013, 8:43

    I changed the pom.xml file as follows:

    <?xml version="1.0" encoding="UTF-8"?>
    <project>
    	<modelVersion>4.0.0</modelVersion>
    	<groupId>Spring3HibernateMaven</groupId>
    	<artifactId>Spring3HibernateMaven</artifactId>
    	<packaging>war</packaging>
    	<version>0.0.1-SNAPSHOT</version>
    	<description></description>
    	<build>
    		<plugins>
    			<plugin>
    				<artifactId>maven-compiler-plugin</artifactId>
    				<configuration>
    					<source>1.5</source>
    					<target>1.5</target>
    				</configuration>
    			</plugin>
    			<plugin>
    				<artifactId>maven-war-plugin</artifactId>
    				<version>2.0</version>
    			</plugin>
    		</plugins>
    	</build>
    	<dependencies>
    		<dependency>
    			<groupId>javax.persistence</groupId>
    			<artifactId>persistence-api</artifactId>
    			<version>1.0</version>
    		</dependency>
    		<dependency>
    			<groupId>javax.servlet</groupId>
    			<artifactId>servlet-api</artifactId>
    			<version>2.5</version>
    		</dependency>
    		<dependency>
    			<groupId>org.springframework</groupId>
    			<artifactId>spring-beans</artifactId>
    			<version>${org.springframework.version}</version>
    		</dependency>
    		<dependency>
    			<groupId>org.springframework</groupId>
    			<artifactId>spring-jdbc</artifactId>
    			<version>${org.springframework.version}</version>
    		</dependency>
    		<dependency>
    			<groupId>org.springframework</groupId>
    			<artifactId>spring-web</artifactId>
    			<version>${org.springframework.version}</version>
    		</dependency>
    		<dependency>
    			<groupId>org.springframework</groupId>
    			<artifactId>spring-webmvc</artifactId>
    			<version>${org.springframework.version}</version>
    		</dependency>
    		<dependency>
    			<groupId>org.springframework</groupId>
    			<artifactId>spring-orm</artifactId>
    			<version>${org.springframework.version}</version>
    		</dependency>
    		<dependency>
    			<groupId>org.hibernate</groupId>
    			<artifactId>hibernate-core</artifactId>
    			<version>3.3.2.GA</version>
    		</dependency>
    		<!-- dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> 
    			<version>1.4.2</version> </dependency -->
    		<dependency>
    			<groupId>taglibs</groupId>
    			<artifactId>standard</artifactId>
    			<version>1.1.2</version>
    		</dependency>
    		<dependency>
    			<groupId>javax.servlet</groupId>
    			<artifactId>jstl</artifactId>
    			<version>1.1.2</version>
    		</dependency>
    		<dependency>
    			<groupId>mysql</groupId>
    			<artifactId>mysql-connector-java</artifactId>
    			<version>5.1.10</version>
    		</dependency>
    		<dependency>
    			<groupId>commons-dbcp</groupId>
    			<artifactId>commons-dbcp</artifactId>
    			<version>20030825.184428</version>
    		</dependency>
    		<dependency>
    			<groupId>commons-pool</groupId>
    			<artifactId>commons-pool</artifactId>
    			<version>20030825.183949</version>
    		</dependency>
    	</dependencies>
    	<properties>
    		<org.springframework.version>3.0.2.RELEASE
    		</org.springframework.version>
    		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    	</properties>
    </project>
    
  • Vijay 20 May, 2013, 12:01

    I have just changed the POM file and it worked.Please use below pom.xml file.

    4.0.0
    Spring3HibernateMaven
    Spring3HibernateMaven
    war
    0.0.1-SNAPSHOT
    Spring3HibernateMaven

    Spring3HibernateMaven

    org.apache.maven.plugins
    maven-compiler-plugin

    1.5
    1.5

    junit
    junit
    4.8.1
    jar
    compile

    javax.servlet
    servlet-api
    2.5

    org.springframework
    spring-beans
    ${org.springframework.version}

    org.springframework
    spring-jdbc
    ${org.springframework.version}

    org.springframework
    spring-web
    3.0.5.RELEASE
    jar
    compile

    org.springframework
    spring-core
    3.0.5.RELEASE
    jar
    compile

    commons-logging
    commons-logging

    log4j
    log4j
    1.2.14
    jar
    compile

    org.springframework
    spring-tx
    3.0.5.RELEASE
    jar
    compile

    javax.servlet
    jstl
    1.1.2
    jar
    compile

    taglibs
    standard
    1.1.2
    jar
    compile

    org.springframework
    spring-webmvc
    3.0.5.RELEASE
    jar
    compile

    org.springframework
    spring-webmvc-portlet
    3.0.5.RELEASE
    jar
    compile

    org.springframework
    spring-aop
    3.0.5.RELEASE
    jar
    compile

    commons-digester
    commons-digester
    2.1
    jar
    compile

    commons-collections
    commons-collections
    3.2.1
    jar
    compile

    org.hibernate
    hibernate-core
    3.3.2.GA
    jar
    compile

    javax.persistence
    persistence-api
    1.0
    jar
    compile

    c3p0
    c3p0
    0.9.1.2
    jar
    compile

    org.springframework
    spring-orm
    3.0.5.RELEASE
    jar
    compile

    org.slf4j
    slf4j-api
    1.6.1
    jar
    compile

    org.slf4j
    slf4j-log4j12
    1.6.1
    jar
    compile

    cglib
    cglib-nodep
    2.2
    jar
    compile

    org.hibernate
    hibernate-annotations
    3.4.0.GA
    jar
    compile

    org.hibernate
    hibernate-entitymanager
    3.4.0.GA

    jboss
    javassist
    3.7.ga
    jar
    compile

    mysql
    mysql-connector-java
    5.1.14
    jar
    compile

    commons-dbcp
    commons-dbcp
    1.4

    commons-pool
    commons-pool
    1.6

    3.0.2.RELEASE
    UTF-8

    • Payal 22 May, 2013, 21:56

      Hi Vijay,

      I have tried everything listed in here in the past 3 days now , including the dependencies as youhave said in pom.xml but I am getting all exceptions and the project does not work.I am using weblogic and eclipse.

      Since you got this working…Can you pls send your project as zipped folder so I can see what I am doing wrong, since admin wont reply ??

      My email id is here . I would appreciate.

      Thanks
      Payal

  • Kamini 21 May, 2013, 16:54

    I think Admin has no interest in replying ..

    • Viral Patel 21 May, 2013, 18:43

      @Kamini: Apologies.. Although I try to reply as much as I can but as there are so many articles and each one gets so many comments everyday, it is difficult to cater all of them. I will try my best though. :)

  • payal 23 May, 2013, 0:22

    I completed and deployed the application in weblogic server, but I am getting the Error: 403 Forbidden when I try to run the app. Can anyone guide what I am doing wrong ????

    I would be so thankful !!!

  • Anita Sahoo 24 May, 2013, 11:22

    where is the list.html n whr shud i write that plzzz helpand from contact .jsp how it goes tyo add.html plz explain i m new to this so plzzz help anyone i would really be thankful..

  • gyan 24 May, 2013, 17:19

    wat if i dont use maven???

  • Anita Sahoo 25 May, 2013, 18:38

    i really want to run this prob just tell me whr to keep the list. html ands add.html files

  • reddy 25 May, 2013, 21:52

    HI ViralPatil,
    I am Getting This error.How to resolve this problem please help me

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'documentController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private net.viralpatel.docmanager.dao.DocumentDAO net.viralpatel.docmanager.controller.DocumentController.documentDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'documentDAO': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hibernate.SessionFactory net.viralpatel.docmanager.dao.DocumentDAO.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/spring-servlet.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/spring-servlet.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotationUtils.getAnnotation(Ljava/lang/reflect/AnnotatedElement;Ljava/lang/Class;)Ljava/lang/annotation/Annotation;
    	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:286)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/spring-servlet.xml]
    
  • falguni 29 May, 2013, 20:29

    In controller class, how the service object is injected ? can you please explain ? as there is no entry in servlet.xml file for service ? How its wired ?

  • ChrisW 6 June, 2013, 18:16

    Nice tut. Thanks a lot!!!

  • Pawel 13 June, 2013, 16:45

    Hi, can anyone explain how to add validation to this form using JSR 303 or Hibernate Validator?

  • Raman Dhawan 13 June, 2013, 20:16

    Very Nicely Explained. Great!! Thanks!!

  • Nilesh 14 June, 2013, 8:26

    Corrected one for 1.6

    4.0.0
    Spring3HibernateMaven
    Spring3HibernateMaven
    war
    0.0.1-SNAPSHOT

    maven-compiler-plugin

    1.6
    1.6

    maven-war-plugin
    2.0

    javax
    javaee-api
    6.0

    javax.transaction
    jta
    1.1

    javax.servlet
    servlet-api
    2.5

    javax.persistence
    persistence-api
    1.0

    org.springframework
    spring-beans
    ${org.springframework.version}

    org.springframework
    spring-jdbc
    ${org.springframework.version}

    org.springframework
    spring-web
    ${org.springframework.version}

    org.springframework
    spring-webmvc
    ${org.springframework.version}

    org.springframework
    spring-orm
    ${org.springframework.version}

    org.hibernate
    hibernate-core
    3.3.2.ga

    org.hibernate
    hibernate-commons-annotations
    3.3.0.ga

    org.hibernate
    hibernate-annotations
    3.3.0.ga


    org.slf4j
    slf4j-log4j12
    1.4.2

    taglibs
    standard
    1.1.2

    javax.servlet
    jstl
    1.1.2

    mysql
    mysql-connector-java
    5.1.10

    commons-dbcp
    commons-dbcp
    20030825.184428

    commons-pool
    commons-pool
    20030825.183949

    3.0.2.RELEASE
    UTF-8

Leave a Reply

Your email address will not be published. Required fields are marked *

Note

To post source code in comment, use [code language] [/code] tag, for example:

  • [code java] Java source code here [/code]
  • [code html] HTML here [/code]