1.controller不是以功能分区,而是用前端传来的数据来区分,用的同一类数据,此一类数据的操作,应该放在一个分区中。
2.insert时,主键id设置的数据库自增,为什么要给它赋null?
设为null时,数据库自动递增
3.302 重定向
HttpResponse response = null;
response = client.execute(httpPost);
//----------判断是否重定向开始 int code = response.getStatusLine().getStatusCode(); String newUrL =""; if (code == 301) { Header header = response.getFirstHeader("location"); // 跳转的目标地址在 HTTP-HEAD 中 newUrL = header.getValue(); // 这就是跳转后的地址,再向这个地址发出新申请,以获取跳转后的信息。 System.out.println(newUrL); System.out.println(code); httppost = new HttpPost(newUrL); httppost.setHeader("Content-Type", "application/json;charset=UTF-8"); httppost.setEntity(strEntity); response = httpclient.execute(httppost); code = response.getStatusLine().getStatusCode(); System.out.println("login"+code); } //------------重定向结束 HttpEntity entity=response.getEntity(); String strReturn = EntityUtils.toString(entity, "UTF-8"); JSONObject jsonReturn =JSON.parseObject(strReturn); String certificate=jsonReturn.getString("ficate"); String certificatekey=jsonReturn.getString("ficatekey");