Modifying the employeecontroller.java file, Modifying the, Employeecontroller.java – HP Integrity NonStop H-Series User Manual
Page 135: File

private String rord;
public String getRord() {
return rord;
}
public void setRord(String rord) {
this.rord = rord;
}
public int getEmpid() {
return empid;
}
public void setEmpid(int empid) {
this.empid = empid;
}
public String getFirstname() {
return firstname;
}
public void setFirstname (String firstname) {
this. firstname= firstname;
}
public String getLastname () {
return lastname;
}
public void setLastname (String lastname) {
this. lastname= lastname;
}
public int getAge () {
return age;
}
public void setAge (int age) {
this. age= age;
}
public String getEmail () {
return email;
}
public void setEmail (String email) {
this. email= email;
}
}
Modifying the
EmployeeController.java
File
The
EmployeeController.java
file in the
com.hp.empinfo.web
package is modified to
map the retrieve or delete request to the underlying database operations.
After modification, the
EmployeeController.java
file appears as:
package com.hp.empinfo.web;
import org.springframework.web.servlet.mvc.SimpleFormController;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.ServletException;
import com.hp.empinfo.domain.Employee;
import com.hp.empinfo.service.EmployeeDao;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
public class EmployeeController extends SimpleFormController {
private EmployeeDao empdao;
public ModelAndView onSubmit(Object command) throws ServletException,
Overview of EmpInfo
135