Struts2.2.1 and hibernate integration application
Posted on: March 4, 2011 at 12:00 AM
Struts2.2.1 and hibernate integration application

Struts2.2.1 and hibernate integration application



When first time this module is loaded it fetch value from database in a table by passing value "InfoList" to action class which calls Dao class to fetch value from database.

Secondly, it contains a form which calls  add() method of action class. This add method insert the value into database using Dao class.


<%@taglib uri="/struts-tags" prefix="s"%>
<%@taglib uri="/struts-dojo-tags" prefix="sx"%>
<title>Information Form </title>
<h2 style="color: gray;"> Struts2+Hibernate Integration Application </h2>
<s:form action="addinfoprocess" >
<s:textfield name="firstname" label="First Name">
<s:textfield name="lastname" label="Last Name"/>
<s:textfield name="age" label="Age"/>
<s:select list="{'Male','Female'}" label="Gender" headerValue="Select Gender" headerKey="" name="gender"/>
<s:textarea name="address" label="Address"/>
<table border="1">
<caption style="color: green;">Information Added by user</caption>
<tr><th>First Name</th>
<th>Last Name</th>
<th> Gender</th>
<s:iterator value="infoList" var="obAddInfo" >
<td><s:property value="firstname"/> </td>
<td><s:property value="lastname"/></td>
<td><s:property value="gender"/></td>
<td><s:property value="age"/></td>
<td><s:property value="address"/></td>
<td><a href="deleteInfo?id1=<s:property value='id'/>">Delete</a></td>

Related Tags for Struts2.2.1 and hibernate integration application:



Advertisement null