您现在的位置:首页 >> 前端 >> 内容

jsp中的搜索条件回显

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

  核心提示:%@ page language=java contentType=text/html; charset=UTF-8pageEncoding=UTF-8%!DOCTYPE html PUBLIC -/...
<%@ 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>

Tags:JS SP P中 中的 
作者:网络 来源:qq_3350063