In this section we will add Spring and Hibernate Capabilities to our web application. So for this, we will have to add the spring and hibernate libraries and configuration files to the web application.
So, to integrate Hibernate and Spring frameworks with JSF framework we will have to make some changes and copy jar files related with the individual frameworks.
Steps to integrate:
Adding Servlets Library
Since we are using ant build tool to compile the application, it is necessary
to make servlets api library available to ant build tool for compiling the java code.
We are
adding Servlets library to the project.
Adding Hibernate Libraries
Now we will download hibernate libraries and add it to the project.
Adding Spring Libraries
Our application uses spring to manage the beans, so we have to add the
spring capabilities to the application.
Finally here is the list of jar files in our application's lib directory:
| HibernateMyfaces\WEB-INF\lib ant-1.6.5.jar ant-antlr-1.6.5.jar ant-junit-1.6.5.jar ant-launcher-1.6.5.jar ant-swing-1.6.5.jar antlr-2.7.6.jar asm-attrs.jar asm.jar c3p0-0.9.1.jar cglib-2.1.3.jar checkstyle-all.jar cleanimports.jar commons-beanutils-1.7.0.jar commons-codec-1.3.jar commons-collections-2.1.1.jar commons-collections-3.1.jar commons-digester-1.6.jar commons-el-1.0.jar commons-fileupload-1.0.jar commons-lang-2.1.jar commons-logging-1.0.4.jar commons-validator-1.3.1.jar concurrent-1.3.2.jar connector.jar dom4j-1.6.1.jar ehcache-1.2.3.jar hibernate3.jar jaas.jar jacc-1_0-fr.jar javassist.jar jaxen-1.1-beta-7.jar jboss-cache.jar jboss-common.jar jboss-jmx.jar jboss-system.jar jdbc2_0-stdext.jar jgroups-2.2.8.jar jstl-1.1.0.jar jta.jar junit-3.8.1.jar log4j-1.2.11.jar myfaces-api-1.1.5.jar myfaces-impl-1.1.5.jar mysql-connector-java-3.0.16-ga-bin.jar mysql-connector-java-3.1.6-bin.jar oro-2.0.8.jar oscache-2.1.jar proxool-0.8.3.jar spring.jar swarmcache-1.0rc2.jar syndiag2.jar tomahawk-1.1.6.jar versioncheck.jar xerces-2.6.2.jar xml-apis.jar |
Now all the libraries are available with us in our application, we will now create database and tables in MySQL to use in our application.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Adding Spring and Hibernate Capabilities
Post your Comment