zoukankan      html  css  js  c++  java
  • 笔记1

    /**
         * 根据id 查找活动对象
         * @throws IOException 
         * */
        public void getFishObj() throws IOException{
            String id = request.getParameter("id");
            Fishing fishing = (Fishing) fishService.getObjectById(id+"");
            
            JsonConfig jsonConfig = new JsonConfig();
            jsonConfig.registerJsonValueProcessor(Date.class, new JSONFormatDate("yyyy-MM-dd HH:mm:ss"));
            JSONObject jo = JSONObject.fromObject(fishing,jsonConfig);// 格式化result
            response.setContentType("text/html;charset=utf-8");
            PrintWriter out = response.getWriter();
            out.println(jo.toString());
            out.flush();
            out.close();
        }
    $.ajax({
       type: "POST", dataType: "JSON",
       url: "${pageContext.request.contextPath}/back/fish/getFishObj.action",
       data: {id:rows[0].fishId},
       success: function(data){
           $("#fishId").val(data.fishId);
           $("#fishName").val(data.fishName);
           $("#shopName").val(data.shopName);
           $("#factoryName").val(data.factoryName);
           $("#address").val(data.address);
       }
    });
  • 相关阅读:
    [CTSC2008]网络管理
    [HNOI/AHOI2018]转盘
    [HAOI2015]树上染色
    [CTSC2017]吉夫特
    [CTSC2011]幸福路径
    Comet OJ
    2019各省省选试题选做
    HNOI2019 简要题解
    HNOI2019游记
    JOISC2019 简要题解
  • 原文地址:https://www.cnblogs.com/zhan1995/p/9173463.html
Copyright © 2011-2022 走看看