Magazine
 
Integrating JSF, Spring and Hibernate
 

Now follow the following steps to create the application:

  1. Create a directory with the name of your application (HibernateMyFaces) under webapps directory of tomcat.

  2. Create “WEB-INF” directory inside it.
  3. Create other directories as shown in the above image.
  4. Copy libraries files from “myfacesexample-
    simple-1.1.6\WEB-INF\lib”
    directory to “lib” directory.
  5. Create web.xml file under WEB-INF directory and add the following content.

<?xml version=”1.0"?>
<!DOCTYPE web-app PUBLIC “-//Sun
Microsystems, Inc.//DTD Web Application 2.3/
/EN” “http://java.sun.com/dtd/webapp_
2_3.dtd”>
<web-app>
<!— Spring context Configuration Begins—>
<context-param>
<param-name>log4jConfigLocation</
param-name>
<param-value>/WEB-INF/log4j.properties</
param-value>

 

</context-param>
<context-param>
<param-name>contextConfigLocation</
param-name>
<param-value>/WEB-INF/
applicationContext-hibernate.xml</paramvalue>
</context-param>
<servlet>
<servlet-name>context</servlet-name>
<servlet-class>
org.springframework.web.context.
ContextLoaderServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!—End Spring configuration —>
<context-param>
<param-name>
javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/facesconfig.
xml</param-value>
</context-param>
<context-param>
<paramname>
javax.faces.STATE_SAVING_METHOD</
param-name>
<param-value>client</param-value>
</context-param>
<!— Extensions Filter —>
<filter>
<filter-name>extensionsFilter</filtername>
<filter-class>
org.apache.myfaces.component.html.util.E
xtensionsFilter </filter-class>
<init-param>
<param-name>uploadMaxFileSize</
param-name>
<param-value>100m</param-value>
<description>Set the size limit for
uploaded files.
Format: 10 - 10 bytes
10k - 10 KB
10m - 10 MB
1g - 1 GB
</description>
</init-param>
<init-param>

Jan 2008 | Java Jazz Up | 55
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