<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<jsp:useBean id="student" class="com.entities.Student" scope="session"/>
<jsp:setProperty name="student" property="*"/>
<jsp:setProperty name="student" property="age" value="30"/>
<html>
<head>
<base href="<%=basePath%>">
<title>myJsp</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<%if(student.isQuery()){ %>
<h2>查询结果</h2>
姓名: <jsp:getProperty name="student" property="name"/>
学号: <jsp:getProperty name="student" property="stuCode"/>
年龄: <jsp:getProperty name="student" property="age"/>
<%} %>
<hr/>
<h2>学生</h2>
<form name="javabean" action="index.jsp" method="get">
<input type="hidden" name="query" value="true"/>
<p>姓名:<input type="text" name="name"></p>
<p>学号:<input type ="text" name="StuCode"></p>
<p>年龄:<input type="text" name="age"/></p>
<p>
<input type="submit" value="提交"/>
<input type="reset" value ="重置"/>
</p>
</form>
</body>
</html>