Servlet jsp当中给出一个doPost例子

3.doGet,doPost和service的用法 (视频下载) (全部书籍)

1)doPost的实例

马克-to-win:我们看到了doGet的用法。这节,我们看看doPost的用法。在Eclipse下,点击你项目名称左边的小十字符号,找到WebContent,右击它。New/HTML File:
?

eclipse会为我们生成一个空的html。我们再加入一些代码,成为:

 

例:3.3.1

 

hello.html:

 

<html>
<body>
<FORM ACTION="MarkToWinServletHello1"
METHOD="POST">
First Name:
<INPUT TYPE="TEXT" NAME="firstName"><BR>
Shipping Address:
<TEXTAREA NAME="address" ROWS=3 COLS=40></TEXTAREA><BR>

Credit Card:<BR>
<INPUT TYPE="RADIO" NAME="cardType"
VALUE="Visa">Visa<BR>
<INPUT TYPE="RADIO" NAME="cardType"
VALUE="Master Card">Master Card<BR>
<INPUT TYPE="SUBMIT" VALUE="Submit Order">
</CENTER>
</FORM>
</body>
</html>

详情请见:http://www.mark-to-win.com/index.html?content=Jsp/jspUrl.html&chapter=Jsp/jsp1_web.html#ServletDoPostExample

相关文章