81,092
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>test.html</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<form name="f1" id="f1" action="result.do?method=src" method="get">
<table border="0">
<tr>
<td>
</td>
<td>
<input type="text" name="word">
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="搜索">
</td>
</tr>
</table>
</form>
</body>
</html>
public class RecordServlet extends HttpServlet {
// private Searcher s;
public RecordServlet() {
super();
/*
* try { s = new Searcher("D:/index", 10); } catch (Exception e) {
* System.out.println(e); }
*/
}
// ----------------------------------------------------------------------------
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
request.setCharacterEncoding("utf-8");
String me = request.getParameter("method");//得到method的值src
System.out.println(me);
}
}