日期:2014-05-16 浏览次数:20753 次
$("#form1").form({
url : "testServlet",
method:"post",
onSubmit : function(none) {
return $(this).form('validate');
},
success : function(data) {
$.messager.alert("提示", data);
}
});
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");
String message = "{success:true,message:";
String name = request.getParameter("name");
System.out.println(name);
String eml = request.getParameter("eml");
String word = request.getParameter("word");
String age = request.getParameter("age");
String url = request.getParameter("url");
message = message +"name "+name+"<br/>eml "+eml+"<br/>word "+word+"<br/>age "+age+"<br/>url "+url + "}";
response.getWriter().println(message );
}