Magazine
 
Integrating JSF, Spring and Hibernate
 

description=”Generate JavaDoc API docs”>
<delete dir=”./doc/api”/>
<mkdir dir=”./doc/api”/>
<javadoc sourcepath=”./src/java” destdir=”./
doc/api”
classpath=”${servlet.jar}:${jdbc20ext.jar}”
packagenames=”*”
author=”true” private=”true” version=”true”
windowtitle=”${project.title} API
Documentation”
doctitle=”&lt;h1&gt;${project.title}
Documentation (Version
${project.version})&lt;/h1&gt;”
bottom=”Copyright &#169;
2002">
<classpath
refid=”compile.classpath”/>
</javadoc>
</target>
<!— Build entire project —>
<target name=”project”
depends=”clean,prepare,compile”/>
<!— Build project and create
distribution—>
<target name=”all” depends=”project”/>
</project>

We will use ant tool to build the application, so make sure ant tool is installed on your development machine.

9. Create directory with name “net” in “java” directory and directory of name “roseindia” within “net” directory.

10. Create “classes” directory within “WEB-INF” directory for the class file to be used in the application.

4. Adding Spring and Hibernate Capabilities

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.

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.

1. Create a directory named libext under WEB-INF directory of your application.

2. Copy servlet-api.jar from common\lib directory of your Tomcat into libext directory.

Adding Hibernate Libraries
Now we will download hibernate libraries and add it to the project.
1. Download hibernate-3.2.4.sp1.zip or latest version from http:// www.hibernate.org/6.html. We have downloaded hibernate-3.2.4.sp1.zip for this tutorial.
2. Unzip the file.
3. Copy all the jar files from hibernate-
3.2.4.sp1\hibernate-3.2\lib into lib directory of your application. (The directories hibernate-3.2.4.sp1\hibernate-3.2 may be different in your case depending on the downloaded version).
4. Copy hibernate3.jar from hibernate- 3.2.4.sp1\hibernate-3.2 into lib directory of your application.

Adding Spring Libraries
Our application uses spring to manage the beans, so we have to add the spring capabilities to the application.
1. Download spring-framework-2.0.5- with-dependencies.zip from http://www.springframework.org/download.
2. Extract the file.

Jan 2008 | Java Jazz Up | 58
previous
index
next
 
View All Topics
All Pages of this Issue
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,

30
, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53 , 54, 55, 56, 57,

58
, 59, 60, 61, 62, 63 , 64, 65 , 66 , 67 , 68 , 69 , 70 , 71 , 72 , 73 , 74 , 75 , 76 , 77 , 78 , 79 , 80 , 81 , 82 ,

83, 84 , 85 , 86, 87 , 88, 89 , 90 , 91 , 92 , 93 , 94 , 95 , 96 , 97 , 98 , 99 , 100 , 101 , 102 , 103, 104 , 105 ,

106, 107,

Download PDF