Servlet处理POST请求

王朝other·作者佚名  2008-05-31
窄屏简体版  字體: |||超大  

下面介绍一个HTTP Servlet处理POST方式的例子,见示例14-3。

【程序源代码】

1 // ==================== PRogram Description ==========================

2 // 程序名称:示例14-3 : SurveyExample.Html

3 // 程序目的:SurveyExample源代码

4 // ==============================================================

5 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">

6 <html>

7 <head>

8 <title>javaUsageSurvey</title>

9 </head>

10

11 <body bgcolor=#ffffff>

12 <p><img src=http://www.supcode.com/Article/html/4/43/2005/02/10/images/BEA_Button_Final_web.gifalign=right>

13 <blockquote>

14 <font face="helvetica">

15 <form action="SurveyServlet" method=POST>

16 <input type=hidden name=survey value=Survey01Results>

17 <BR><BR>How Many Employees in your Company?<BR>

18 <BR>1-100<input type=radio name=employee value=1-100>

19 <BR>100-200<input type=radio name=employee value=100-200>

20 <BR>200-300<input type=radio name=employee value=200-300>

21 <BR>300-400<input type=radio name=employee value=300-400>

22 <BR>500-more<input type=radio name=employee value=500-more>

23 <BR><BR>General Comments?<BR>

24 <BR><input type=text name=comment>

25 <BR><BR>What IDEs do you use?<BR>

26 <BR>JavaWorkShop<input type=checkbox name=ide value=JavaWorkShop>

27 <BR>J++<input type=checkbox name=ide value=J++>

28 <BR>Cafe‘<input type=checkbox name=ide value=Cafe‘>

29 <BR><BR><input type=submit><input type=reset>

30 </form>

31 </font>

32 </blockquote>

33 </body>

34 </html>

【程序输出结果】

在客户端IE浏览的效果如图14-5所示。

screen.width-600)this.style.width=screen.width-600;"

图14-5 客户端浏览效果

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航