Magazine
 
Integrating JSF, Spring and Hibernate
 

implementation.
—>
<bean id=”HibernateSpringDaoTarget”
class=”net.roseindia.dao.
HibernateSpringDAOImpl”>
<property name=”sessionFactory”><ref
local=”sessionFactory”/></property>
</bean>
<!—
- Transactional proxy for Application’s central
data access object.
-
- Defines specific transaction attributes with
“readOnly” markers,
- which is an optimization that is particularly
valuable with Hibernate(to suppress
unnecessary flush attempts for read-only
operations).
-Note that in a real-life app with multiple
transaction proxies,
-you will probably want to use parent and
child bean definitionsas described in the
manual, to reduce duplication.
—>
<bean id=”SpringHibernateDao”
class=”org.springframework.transaction.
interceptor.TransactionProxyFactoryBean”>
<property name=”transactionManager”>
<ref local=”transactionManager”/>
</property>
<property name=”target”><ref
local=”HibernateSpringDaoTarget”/>
</property>
<property name=”transactionAttributes”>
<props>
<prop
key=”get*”>PROPAGATION_REQUIRED,readOnly
</prop>
<prop key=”find*”>
PROPAGATION_REQUIRED,readOnly
</prop>
<prop key=”load*”>
PROPAGATION_REQUIRED,readOnly</prop>
<prop key=”store*”>
PROPAGATION_REQUIRED
</prop>
<prop key=”add*”>
PROPAGATION_REQUIRED
</prop>

 

 

</props>
</property>
</bean>
</beans>

This application is supported with full free code. In the next section we will show you how you can download and install it on your computer.

12. Download full code of JSF, Spring and Hibernate based Registration program

From this page you can download the source code of the application.

Downloading code
Download the code of the application.

Extracting and Installing the code on Tomcat Extract the downloaded file and copy HibernateMyfaces directory to tomcat webapps directory. This will install application on tomcat server.

Creating database
Follow the steps given in the previous section and create database for testing the application. Changing the database login information Go to HibernateMyfaces\WEB-INF directory and edit jdbc.properties to point to your database.

Compile the application

To compile the program ant tool must be installed on your system. Open console and go to HibernateMyfaces\WEB-INF\src directory and type ant command. This will compile your program.

Running and testing the program

Start tomcat and type http:// localhost:8080/HibernateMyfaces/ . You browser will display the login page as shown below.

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