首页 > 移动平台 > 详细

Android 开发服务类 04_ServletForPOSTMethod

时间:2015-05-30 19:49:01      阅读:282      评论:0      收藏:0      [点我收藏+]

ServletForPOSTMethod 业务类

 1 package com.wangjialin.internet.servlet;
 2 
 3 import java.io.IOException;
 4 import javax.servlet.ServletException;
 5 import javax.servlet.annotation.WebServlet;
 6 import javax.servlet.http.HttpServlet;
 7 import javax.servlet.http.HttpServletRequest;
 8 import javax.servlet.http.HttpServletResponse;
 9 
10 @WebServlet("/ServletForPOSTMethod")
11 public class ServletForPOSTMethod extends HttpServlet {
12     
13     private static final long serialVersionUID = 1L;
14          
15     protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
16         // TODO Auto-generated method stub
17     }
18 
19     protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
20         
21         String name = request.getParameter("name");
22         String age = request.getParameter("age");
23         System.out.println("name from POST method: " + name );
24         System.out.println("age from POST method: " + age );
25     }
26 
27 }

 

Android 开发服务类 04_ServletForPOSTMethod

原文:http://www.cnblogs.com/renzimu/p/4540836.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!