The scope </ font> in Java Servlet / JSP is the area where the instance can be saved. You can keep an instance within the scope area and share or pass it between the Servlet class and JS.
JavaBeans </ font> is a design pattern that enhances class independence and makes it easier to reuse as a part.
Human.java
package model;
import java.io.Serializable;
public class Human implements Serializable {
private String name;
private int age;
public Human() {}
public Human(String name, int age) {
this.name=name;
this.age=age;
}
public String getName() { return name; }
public void setName(String name) { this.name=name; }
public int getAge() { return age; }
public void setAge(int age) { this.age=age; }
}
The instance attribute property </ font> is generated from the setter / getter method.
Recommended Posts