回覆列表
  • 1 # 被囚禁的王者

    ajax方法:$.ajax( { type : "POST", url : "/home/user/login.htm", //訪問路徑 data : {name: name, title: title}, //引數 success : function(msg) { if (msg == 1) { } else { } }, error:function(msg){ alert("程式出錯,請聯絡管理員"); }});java類方法:@RequestMapping("user/login.htm")public String getAddGroupsAjax(String name,String title) throws Exception{ HttpServletResponse response = getResponse(); response.setContentType("text/html;charset=UTF-8"); PrintWriter pw = null; //方法處理,最後返回一個字元竄,來判斷是成功還是失敗了 try { pw = response.getWriter(); pw.print(str); } catch (IOException e) { //錯誤處理 }finally{ pw.close(); } return null;}

    以上最少需要你懂一些springMVC,不然的話我也沒辦法

  • 中秋節和大豐收的關聯?
  • brandnewdays是什麼意思,尤其是brand?