test.jsp

来自「用jsp所编写」· JSP 代码 · 共 67 行

JSP
67
字号
<%@ page language="java" contentType="text/html; charset=GBK"
	pageEncoding="GBK"%>
<%@page import="com.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
	<script language="javascript">

 function check()
{

if(document.myform.query.value=="")
{window.alert("请输入查询语句");
document.myform.query.focus();
return false;

}
}
</script>

		<meta http-equiv="Content-Type" content="text/html; charset=GBK">
		<title>Insert title here</title>
	</head>
<%String query = request.getParameter("query");
			request.setCharacterEncoding("GBK"); %> 	
	<body>
		<form method="post" action="test.jsp" name="myform">
			<p>
				&nbsp;
			</p>
			<p>
				&nbsp;&#35831;&#36755;&#20837;&#23383;&#27573;&#30340;&#20869;&#23481;
			</p>
			<p>
				&nbsp;
				<input name="query">
			</p>
			<p>
				&nbsp;
			</p>
			<p>
				&nbsp;
				<input type="submit" name="bu" onclick="return check();" value=提交>
			</p>
			<p>
				&nbsp;
			</p>
		</form>


		<%
		
			if (query != "" && query != null)

			{
				String sql = "select * from inhibitor where AcNumber='" + query
				+ "'";

				GetResultByFormat table = new GetResultByFormat();

				StringBuffer bu = table.getResult_withTableFormat(sql);
				out.print(bu);
			}
		%>
	</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?