1.建立模型对象:
package com.java.model;
public class Student {
private String name;
private int 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;
}
}
2.建立jsp,在jsp中引用后台Student对象
pageEncoding="utf-8"%>
Insert title hereStudent student=new Student();
student.setName("小王");
student.setAge(10);
%>