maidanglao12 2016-02-03 02:12 采纳率: 0%
浏览 1866
已结题

Struts1中map转换成json传到前台时取不到值——求指点!

后台报这个:

  • Property 'servlet' has no read method. SKIPPED
  • Property 'servletFor' has no read method. SKIPPED
  • Property 'servlet' has no read method. SKIPPED
  • Property 'servletFor' has no read method. SKIPPED
  • Property 'servlet' has no read method. SKIPPED
  • Property 'servletFor' has no read method. SKIPPED
  • Property 'servlet' has no read method. SKIPPED
  • Property 'servletFor' has no read method. SKIPPED
  • Property 'servlet' has no read method. SKIPPED
  • Property 'servletFor' has no read method. SKIPPED
  • Property 'servlet' has no read method. SKIPPED
  • Property 'servletFor' has no read method. SKIPPED
  • Property 'servlet' has no read method. SKIPPED
  • Property 'servletFor' has no read method. SKIPPED

Java代码 :

HttpSession session=request.getSession();
    String logincode= "";
    if(this.exportProvider==null){
        this.exportProvider=new ExportProviderImpl();
    }

    if (request.getSession().getAttribute("loginCode")!=null) {
        logincode=request.getSession().getAttribute("loginCode").toString();
    }
    try {

         response.setHeader("Content-Disposition", "attachment;filename=" + java.net.URLEncoder.encode("财务批量数据", "UTF-8") + ".xls");
         response.setContentType("application/vnd.ms-excel"); 
         HashMap maps=new HashMap();
         if (!"86".equals(logincode)) {
             maps.put("logincode", logincode);
        }
        Map m=this.exportProvider.getJigouYear();
        List l1=(List)m.get("年");
        List l2=(List)m.get("机构");
        JSONObject jo=JSONObject.fromObject(m);
        response.getWriter().print(jo); 
        response.getWriter().flush();
        response.getWriter().close();
    } catch (Exception e) {

        e.printStackTrace();
    }
    return null;

前台 :

$.ajax({

type: "POST",

url: "../main/exportexclelist2.action",

//json格式接收数据

dataType: "json",

success: function (data) {

alert(data[i]);
}

});

}

Struts配置:


  • 写回答

3条回答 默认 最新

  • maidanglao12 2016-02-03 02:18
    关注


    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题