记录一下 js直接取出java后台传输的数据

js文件

<script type="text/javascript">
        $(function(){
            var name = [[${act.name?default('未设置')}]];
            alert(name);
        });
</script>

后台文件

 public ModelAndView getAdActivityListById(@RequestParam(value = "id") Integer id) {
        ModelAndView model = new ModelAndView();

        
        Long companyId = getCompany().getCompanyId();
        AdActivity act = adActivityService.selectAdActivityId(id, companyId);
        List<AdActivityApplyState> statelist = adActivityService.selectApplyBycompanyAndApply(companyId, id);
        model.addObject("act", act);
        model.addObject("aas", statelist);//ActivityApplyState
        List<ResourceQuota> res = resourceApplyService.selectResourceQuotaList(companyId);
        model.addObject("res", res);

        model.setViewName("user/adactivity/listAdActivityOne");
        return model;
    }

作为学习笔记

猜你喜欢

转载自blog.csdn.net/qq_37121548/article/details/81197338