beautypg.com

Creating a simple pojo, Developing business – HP Integrity NonStop J-Series User Manual

Page 62

background image

http://:/<servlet directory>/EmpInfo

.

Developing Business Logic and Providing the Web Interface

This section describes the following tasks:

1.

“Creating a Simple POJO” (page 62)

2.

“Creating Data Access Object Implementation for JDBC” (page 63)

3.

“Creating and Modifying Supporting Views to Display Business Data” (page 63)

4.

“Adding Dependency JAR Files” (page 64)

Creating a Simple POJO

1.

Create a com.hp.empinfo.domain package and an Employee class in the
com.hp.empinfo.domain

package, as described in

“Creating the Controller for EmpInfo”

(page 54)

.

2.

Modify the Employee.java class file to add some properties and their getter and setter
methods.

After modification, the Employee.java file must appear as:

package com.hp.empinfo.domain;

public class Employee implements java.io.Serializable {

private int empid;;
private String firstname;
private String lastname;
private int age;
private String email;

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;
}
}

62

Spring Framework

This manual is related to the following products: