站内搜索:
首页 >> 前端 >> 内容
jsp中的搜索条件回显

时间:2017/1/10 11:07:30

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "https://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>

</body>
</html>

  • 上一篇:HTTP中的GET和POST何时使用
  • 下一篇:谷哥的小弟学前端(03)——CSS基础知识(1)
  • 返回顶部