zoukankan      html  css  js  c++  java
  • 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的配置不在配返回值

  • 相关阅读:
    Neko Performs Cat Furrier Transform CodeForces
    Neko does Maths CodeForces
    Game HDU
    HDU
    CF1155D Beautiful Array 贪心,dp
    二维差分
    B
    一维差分
    状压dpHDU
    [转载] HBase vs Cassandra:我们迁移系统的原因
  • 原文地址:https://www.cnblogs.com/anyhow/p/3912141.html
Copyright © 2011-2022 走看看