如何在jsp页面添加搜索功能 博客频道
推荐于2017-12-16
展开全部
jsp查询关键字是用户通过文本框输入后传到db检索结果然后返回页面。
举例如下:
<%@ page contentType="text/html;charset=gb2312" %>
<%@ page language="java" import="java.sql.*"%>
<jsp:useBean id="connc" scope="page" class="db.ConnOracle"/>
<%
String sql = "";
String key = "";
String type= "";
String sortfield = "";
%>
<%
request.setCharacterEncoding("gb2312");
sql = "select * from student";
key = request.getParameter("mkey");
System.out.print(key);
type = request.getParameter("mtype");
sortfield = request.getParameter(
举例如下:
<%@ page contentType="text/html;charset=gb2312" %>
<%@ page language="java" import="java.sql.*"%>
<jsp:useBean id="connc" scope="page" class="db.ConnOracle"/>
<%
String sql = "";
String key = "";
String type= "";
String sortfield = "";
%>
<%
request.setCharacterEncoding("gb2312");
sql = "select * from student";
key = request.getParameter("mkey");
System.out.print(key);
type = request.getParameter("mtype");
sortfield = request.getParameter(
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询