今天下午在公司改完bug,经理说,你的搜索条件在提交后,不要clean,于是弄了半天才弄出来,
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
String a=request.getParameter("hehe");
request.setAttribute("temp", a);
%>
<form method="get" action="">
搜索条件:<input type="text" name="hehe" id="hehe" value="<%=request.getAttribute("temp")==null?"":request.getAttribute("temp") %>"/>
<input type="submit" value="搜素">
</form>
<input type="submit" value="搜素">
</form>
</body>
</html>
方法二、用于此种情况下还可以用ajax技术完成此种情形的功能