"text/html");PrintWriter out =
response.getWriter();
out.println("json");out.flush();returnnull;输入结果:json二、通过struts返回stream来输出action代码publicclass TextResultextendsActionSupport {privateInputStream inputStream;publicInputStream getInputStream() {returninputStream;}publicStringexecute()throwsException {
inputStream=newStringBufferInputStream("json");returnSUCCESS; }}xml配置
使用这个插件,默认会把action中所有有get方法的属性把输出,可以使用@JSON(serialize
=false)这个注解进行取消。