beautypg.com

Modifying the empinfo-servlet.xml file – HP Integrity NonStop J-Series User Manual

Page 78

background image

model.put("empln", emp1.getLastname());
model.put("empage", "" + emp1.getAge());
model.put("empemail", emp1.getEmail());

return new ModelAndView("retrieveresult", "model", model);

}

if (rord!=null && rord.equalsIgnoreCase("Delete")) {

String str = empdao.deleteEmployee(empid);

Map model = new HashMap();
model.put("del", str);
return new ModelAndView("deleteresult", "model", model);

}

else {
empdao.insertDetail(empid, firstname, lastname, age, email);

Map model = new HashMap();
model
.put("add",
"Transaction Complete - One Employee Added to Employee Database");
return new ModelAndView("insertresult", "model", model);

}

}
}

Modifying the EmpInfo-servlet.xml File

Modify the EmpInfo-servlet.xml file in the EmpInfo/WebContent/WEB-INF directory to
map the command name and its corresponding command class for retrieveordelete.jsp.

After modification, the EmpInfo-servlet.xml file appears as:


xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">

class="com.hp.empinfo.web.EmployeeController">

insert


com.hp.empinfo.domain.Employee


emp

78

Spring Framework

This manual is related to the following products: