Servlet中的doGet和doPost
doGet()
doPost()
:
public void doGet(HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException { String id = req.getParameter("realname"); String password = req.getParameter("mypassword");}public void doPost(HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException { String id = req.getParameter("realname"); String password = req.getParameter("mypassword");}
<form action="identification" method="post" enctype="multipart/form-data"> User Name: <input type="text" name="realname"> Password: <input type="password" name="mypassword"> <input type="submit" value="Identification"></form>
method = "get"
method = "post"
null
慕沐林林
相关分类