Modifying the applicationcontext.xml file – HP Integrity NonStop J-Series User Manual
Page 228
![background image](/manuals/397993/228/background.png)
if (rord != null && rord.equalsIgnoreCase("Delete")) {
String str = empdao.deleteEmployee(empid);
Map
model.put("del", str);
return new ModelAndView("deleteresult", "model", model);
}
else {
empdao.insertDetail(empid, firstname, lastname, age, email);
Map
model
.put("add",
"Transaction Complete - One Employee Added to Employee Database");
return new ModelAndView("insertresult", "model", model);
}
}
Modifying the applicationContext.xml File
Modify the applicationContext.xml file to include the following:
1.
Transaction Manager: It contains the bean definition for the transaction manager class.
NOTE:
Because the EmpInfo application contains only JDBC operations,
org.springframework.jdbc.datasource.DataSourceTransactionManager
is
used as the transaction manager class.
2.
AOP Configurations: It contains reference to the transaction advisor and the class on which
the transaction advise will be applicable.
3.
Transaction Advice: It contains references to the transaction manager class and transactional
details of the getEmployeeDetail, insertEmployee and deleteEmployee methods
in the EmployeeDao.java class.
4.
AOP Proxy Factory Bean: It creates an AOP proxy factory bean that contains the business
interface and the implementation class as the target.
228 Integrating Frameworks