📄 goodssearch.jsp
字号:
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%@ page import="com.qyg.shop.product.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'goodssearch.jsp' starting page</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">
-->
<script type="text/javascript">
function keywordcheck(){
if (document.all("keyword").value==""){
alert("请输入关键字");
return false;
}
return true;
}
function idcheck(){
if (document.all("ID").value==""){
alert("请输入您要查询商品的ID号");
return false;
}
return true;
}
function pricecheck(){
if (document.all("lowprice").value==""){
alert("请输入您要查询商品的价格下限");
return false;
}else if (document.all("topprice").value==""){
alert("请输入您要查询商品的价格上限");
return false;
}
return true;
}
</script>
</head>
<body bgcolor="D9EAFC">
<p align=center>商品查询: <br>
<form action="servlet/ActionServlet">
<input type="hidden" name="action" value="lead"/>
<input type="submit" name="leadbutton" value="购买导航"/>
</form>
<form action="servlet/ActionServlet" onsubmit="return keywordcheck()">
<input type="hidden" name="action" value="keywordSearch"/>
商品关键字:
<input type=text name="keyword"><br>
排列方式:
<select name=orderby>
<option>商品ID号
<option>商品名称
<option>商品价格
<option>商品种类
</option></select>
<input type="submit" name=button1 value="搜索">
</form>
<form action="servlet/ActionServlet" onsubmit="return pricecheck()">
<input type="hidden" name="action" value="priceSearch"/>
价格下限:
<input type=text name="lowprice"><br>
价格上限:
<input type=text name="topprice"><br>
排列方式:
<select name=orderby>
<option>商品ID号
<option>商品名称
<option>商品价格
<option>商品种类
</option></select>
<input type=submit name=submit value="搜索">
</form>
<%
String errorInfo = request.getParameter("errInfo");
if(errorInfo!=null&&errorInfo.equals("pricenum_error")){
out.print("<font color=red>输入价格格式错误,请重新输入</font>");
}
%>
<br>
<form action="servlet/ActionServlet" onsubmit="return idcheck()">
<input type="hidden" name="action" value="idSearch"/>
商品ID号:
<input type=text size="15" name="ID">
<input type=submit name=submit value="搜索">
</form>
<%
errorInfo = request.getParameter("errInfo");
if(errorInfo!=null&&errorInfo.equals("idnum_error")){
out.print("<font color=red>输入ID格式错误,请重新输入</font>");
}
%>
<br>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -