ExtJs 4 的filefield上传后 返回值success接受不正常

问题解决了,我修改了返回类型为setContentType("text/html")可以正确解析了,感到很奇怪,其他的地方使用
setContentType("application/Json")都没问题,就上传的返回有问题了。
success:function(){}这里的解析是extJS解析收到的返回json后才会执行的,如果你的json字符串有问题,这里是不会执行的,好了结贴了。

try {
			ServletActionContext.getResponse().setCharacterEncoding("utf-8");
			ServletActionContext.getResponse().setContentType("text/html");  
			if(success==true){
				ServletActionContext.getResponse().getWriter().write("{\"success\":true}");
			} else {
				ServletActionContext.getResponse().getWriter().write("{\"success\":false}");
			}
		} catch (IOException e) {
			e.printStackTrace();
		}

 struts2的配置不在配返回值

 

posted @ 2014-08-14 11:22  anyhow  阅读(1502)  评论(0编辑  收藏  举报