SSM处理接收到的android传来的request请求

@RequestMapping("/adduser.json")
public void  adduserFromClient(HttpServletRequest request, HttpServletResponse response) throws Exception {


    System.out.println(request.getParameter("email"));
    System.out.println(request.getParameter("password"));

    //操作数据库




    response.setContentType("application/json");
    PrintWriter out =null;
    JSONObject jsonObject = new JSONObject();
    try {
        out = response.getWriter();
        jsonObject.put("status", 1);
        out.write(jsonObject.toString());
        System.out.println(jsonObject.toString());
    } catch (Exception e) {
        // TODO: handle exception
    }finally {
        out.flush();
        out.close();
    }

}
@RequestMapping("/usercheck.json")
public void  usercheckFromClient(HttpServletRequest request, HttpServletResponse response) throws Exception {


    System.out.println(request.getParameter("email"));
    System.out.println(request.getParameter("password"));

    //操作数据库




    response.setContentType("application/json");
    PrintWriter out =null;
    JSONObject jsonObject = new JSONObject();
    try {
        out = response.getWriter();
        jsonObject.put("status", 1);
        out.write(jsonObject.toString());
        System.out.println(jsonObject.toString());
    } catch (Exception e) {
        // TODO: handle exception
    }finally {
        out.flush();
        out.close();
    }

}
@RequestMapping("/orderupload.json")
public void  orderuploadFromClient(HttpServletRequest request, HttpServletResponse response) throws Exception {


    String email = new String(request.getParameter("email").getBytes("iso-8859-1"), "utf-8");
    String tname = new String(request.getParameter("tname").getBytes("iso-8859-1"), "utf-8");
    String tphone = new String(request.getParameter("tphone").getBytes("iso-8859-1"), "utf-8");
    String ttime = new String(request.getParameter("ttime").getBytes("iso-8859-1"), "utf-8");
    String taddress = new String(request.getParameter("taddress").getBytes("iso-8859-1"), "utf-8");
    String tclass = new String(request.getParameter("tclass").getBytes("iso-8859-1"), "utf-8");
    String tsigna = new String(request.getParameter("tsigna").getBytes("iso-8859-1"), "utf-8");
    String telse = new String(request.getParameter("telse").getBytes("iso-8859-1"), "utf-8");



    System.out.println(email);
    System.out.println(tname);
    System.out.println(tphone);
    System.out.println(ttime);
    System.out.println(taddress);
    System.out.println(tclass);
    System.out.println(tsigna);
    System.out.println(telse);

    //操作数据库

// String email = intent.getStringExtra(“email”);
// String tname = intent.getStringExtra(“tname”);
// String tphone = intent.getStringExtra(“tphone”);
// String ttime = intent.getStringExtra(“ttime”);
// String taddress = intent.getStringExtra(“taddress”);
// String tclass = intent.getStringExtra(“tclass”);
// String tsigna = intent.getStringExtra(“tsigna”);
// String telse = intent.getStringExtra(“telse”);

    response.setContentType("application/json");
    PrintWriter out =null;
    JSONObject jsonObject = new JSONObject();
    try {
        out = response.getWriter();
        jsonObject.put("status", 1);
        out.write(jsonObject.toString());
        System.out.println(jsonObject.toString());
    } catch (Exception e) {
        // TODO: handle exception
    }finally {
        out.flush();
        out.close();
    }

}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值