日期:2014-05-17 浏览次数:20775 次
<form action="servlet/ThirdServlet?userName=1&passWord=2" method="post">
<input type="submit" value="提交">
</form>
public class ThirdServlet extends HttpServlet {
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String userName = request.getParameter("uesrName");
String passWord = request.getParameter("passWord");
response.getWriter().println("userName --->"+userName);
response.getWriter().println("passWord---->"+passWord);
}
}
String userName = request.getParameter("uesrName");