柚子快報激活碼778899分享:ajax 學(xué)習(xí) 筆記 提交數(shù)據(jù)
柚子快報激活碼778899分享:ajax 學(xué)習(xí) 筆記 提交數(shù)據(jù)
public String toString() {
return “Role [name=” + name + “, film=” + film + “]”;
}
}
我們的前后端數(shù)據(jù)就主要圍繞這個實體類展開了。
導(dǎo)入相應(yīng)的包和jquery.min.js
解析json數(shù)據(jù)好像用Jackson的比較多(可以參考【3】),但這個用的不是,具體用的包直接參考【2】。
提交數(shù)據(jù)
submit.html:
提交數(shù)據(jù)
影視角色
姓名:
電影:
SubmitServlet:
package edu.hpu.servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import edu.hpu.Pojo.Role;
import net.sf.json.JSONObject;
/**
Servlet implementation class SubmitServlet
*/
public class SubmitServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
public SubmitServlet() {
super();
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
柚子快報激活碼778899分享:ajax 學(xué)習(xí) 筆記 提交數(shù)據(jù)
參考文章
本文內(nèi)容根據(jù)網(wǎng)絡(luò)資料整理,出于傳遞更多信息之目的,不代表金鑰匙跨境贊同其觀點和立場。
轉(zhuǎn)載請注明,如有侵權(quán),聯(lián)系刪除。