public class user {
private String name;
private String address;
private int age;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
}
<form action="neirong.jsp" method="get">
姓名:<input type="text" id="name" name="name"><br>
学校:<input type="text" id="school" name="school"><br>
地址:<input type="text" id="address" name="address"><br>
<input type="submit" value="提交">
<jsp:useBean id="user" class="com.user" scope="session"></jsp:useBean>
<jsp:setProperty name="user" property="*"></jsp:setProperty>
<jsp:getProperty name="user" property="name"/>
<jsp:getProperty name="user" property="address"/>
<jsp:getProperty name="user" property="age"/>