panxuejun
//确保JSP和servlet的编码方式一致
resp.setContentType("text/html;charset=GBK");
List<String> jymdList = new ArrayList<String>();
PrintWriter out = null;
    try {
        //从数据库中取得List
        jymdList = efileViewUiService.getLymd();
        //简单粗暴,对于Map这句也适用
        String json = JSON.toJSONString(jymdList);
        //取得流向JSP传递数据    
        PrintWriter out = resp.getWriter();
        out.print(json);
    } catch (BaseException e) {
        e.printStackTrace();
    } finally{
        out.close();      
    }
            
复制代码

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-01-02
  • 2022-02-24
  • 2021-11-21
  • 2021-12-27
  • 2022-01-16
  • 2022-01-14
  • 2022-12-23
猜你喜欢
  • 2021-12-31
  • 2021-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案