Struts2.2.1 and hibernate integration application
Posted on: March 4, 2011 at 12:00 AM
In this application, you will see how to integrate struts2.2.1 and hibernate.

Struts2.2.1 and hibernate integration application


struts.xml 

Description

Configuration file is used for initialization resource like interceptor action constant and package. It also divide application in the module.

This struts.xml configuration file guides throughout the application what action should be taken at a certain action. For example, it calls action class InformationAction when deleteInfo action is called. This action is calling the method "delete" of "InformationAction" action class.

Code

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.devMode" value="false" />

<package name="default" namespace="/" extends="struts-default">
<action name="addinfoprocess" class="net.roseindia.action.InformationAction"
method="add">
<result name="error" type="chain">mainPage</result>
<result name="success" type="chain">mainPage</result>
</action>
<action name="deleteInfo" class="net.roseindia.action.InformationAction"
method="delete">
<result name="success" type="chain">mainPage</result>
</action>
<action name="mainPage" class="net.roseindia.action.InformationAction" >
<result name="input">AddInforForm.jsp</result> 
<result name="success">AddInforForm.jsp</result>
</action> 
</package>
</struts>

Related Tags for Struts2.2.1 and hibernate integration application :

Advertisements

Ads

 
Advertisement null

Ads