Nonsense not much said, directly to everyone to paste code, the specific code as follows:
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >
New json.jsp File:
<%@ page language= "java" import= "java.util.*" pageencoding= "UTF-8"
%> <% Request.setcharacterencoding ("UTF-8");//Prevent garbled!
String name = Request.getparameter ("name");
String address = Request.getparameter ("address");
String comment = request.getparameter ("comment");
SYSTEM.OUT.PRINTLN (name + "-" +address + "-" +comment);
Out.println ("{name: '" +name+ "", Address: ' +address+ "', Comment: '" +comment+ '} ');
New xml.jsp File:
<%@ page language= "java" import= "java.util.*" pageencoding= "UTF-8"
%> <% Request.setcharacterencoding ("UTF-8");//Prevent garbled!
String name = Request.getparameter ("XMLName");
String address = Request.getparameter ("xmladdress");
String comment = request.getparameter ("xmlcomment");
SYSTEM.OUT.PRINTLN (name + "-" +address + "-" +comment);
Response.setcontenttype ("Text/xml"); Note that since you are passing in XML, you must write here.
out.print ("<?xml version=\" 1.0\ "encoding=\" utf-8\ "?>");
Out.print ("<root>");
Out.print ("<name>" +name+ "</name>");
Out.print ("<address>" +address+ "</address>");
Out.print ("<comment>" +comment+ "</comment>");
Out.print ("</root>");
Create a new html.jsp file:
<%@ page language= "java" import= "java.util.*" pageencoding= "UTF-8"
%> <% Request.setcharacterencoding ("UTF-8");//Prevent garbled!
String name = Request.getparameter ("HTMLName");
String address = Request.getparameter ("htmladdress");
String comment = request.getparameter ("htmlcomment");
SYSTEM.OUT.PRINTLN (name + "-" +address + "-" +comment);
Out.println ("<div style= ' Background-color: #ffa; padding:20px ' > "+name+" "+address+" "+comment+" </div> ");
The above is a small set up for you to share the jquery form plug-ins using the processing server returns JSON, xml,html data, hope to be helpful.