ApplicationContext context = new ClassPathXmlApplicationContext("applicationBt.xml");
JdbcTemplate jdbcTemplate = (JdbcTemplate)context.getBean("jdbcTemplate");
final JSONArray arr=new JSONArray();
StringBuffer sb = new StringBuffer("");
try {
BufferedReader br = new BufferedReader(new InputStreamReader(this.getRequest().getInputStream(), "utf-8"));
String temp;
while ((temp = br.readLine()) != null) {
sb.append(temp);
}
br.close();
} catch (UnsupportedEncodingException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
JSONObject js =JSONObject.fromObject(sb.toString());
System.out.println("val=="+sb.toString());
String payer_userid = js.get("payer_userid").toString(); //用户主键 NEWID
String b_time = js.get("b_time").toString(); //开始日期
String e_time = js.get("e_time").toString(); //结束日期
PrintWriter out=null;
try {
this.getResponse().setCharacterEncoding("utf-8");
out = this.getResponse().getWriter();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
读取接口入参,可以把接口传来的参数用输入流接收。
最新推荐文章于 2023-10-19 22:35:43 发布