当前位置: 首页 > news >正文

网站开发项目企划书手机网站开发哪家好

网站开发项目企划书,手机网站开发哪家好,龙岗地区做网站公司,网站上做播放器流量算谁的文章目录 1、使用ServletAPI向request域对象共享数据2、使用ModelAndView向request域对象共享数据3、使用Model向request域对象共享数据4、使用map向request域对象共享数据5、使用ModelMap向request域对象共享数据6、Model、ModelMap、Map的关系7、向session域共享数据8、向app…

文章目录

      • 1、使用ServletAPI向request域对象共享数据
      • 2、使用ModelAndView向request域对象共享数据
      • 3、使用Model向request域对象共享数据
      • 4、使用map向request域对象共享数据
      • 5、使用ModelMap向request域对象共享数据
      • 6、Model、ModelMap、Map的关系
      • 7、向session域共享数据
      • 8、向application域共享数据



在这里插入图片描述

1、使用ServletAPI向request域对象共享数据

@RequestMapping("/testServletAPI")
public String testServletAPI(HttpServletRequest request){request.setAttribute("testScope", "hello,servletAPI");return "success";
}

2、使用ModelAndView向request域对象共享数据

@RequestMapping("/testModelAndView")
public ModelAndView testModelAndView(){/*** ModelAndView有Model和View的功能* Model主要用于向请求域共享数据* View主要用于设置视图,实现页面跳转*/ModelAndView mav = new ModelAndView();//向请求域共享数据mav.addObject("testScope", "hello,ModelAndView");//设置视图,实现页面跳转mav.setViewName("success");return mav;
}

3、使用Model向request域对象共享数据

@RequestMapping("/testModel")
public String testModel(Model model){model.addAttribute("testScope", "hello,Model");return "success";
}

4、使用map向request域对象共享数据

@RequestMapping("/testMap")
public String testMap(Map<String, Object> map){map.put("testScope", "hello,Map");return "success";
}

5、使用ModelMap向request域对象共享数据

@RequestMapping("/testModelMap")
public String testModelMap(ModelMap modelMap){modelMap.addAttribute("testScope", "hello,ModelMap");return "success";
}

6、Model、ModelMap、Map的关系

Model、ModelMap、Map类型的参数其实本质上都是 BindingAwareModelMap 类型的

public interface Model{}
public class ModelMap extends LinkedHashMap<String, Object> {}
public class ExtendedModelMap extends ModelMap implements Model {}
public class BindingAwareModelMap extends ExtendedModelMap {}

7、向session域共享数据

@RequestMapping("/testSession")
public String testSession(HttpSession session){session.setAttribute("testSessionScope", "hello,session");return "success";
}

8、向application域共享数据

@RequestMapping("/testApplication")
public String testApplication(HttpSession session){ServletContext application = session.getServletContext();application.setAttribute("testApplicationScope", "hello,application");return "success";
}


在这里插入图片描述


http://www.yayakq.cn/news/428803/

相关文章:

  • 专业建站公司服务个人网站模板素材下载
  • 创意上海专业网站建设设计师网站赚钱
  • 免费自助建站系统外卖网站那家做的好处
  • 被墙的网站有哪些免费自己制作网站教程
  • 如何建网站挣钱autumn wordpress
  • 句容住房和城乡建设局网站开发网站需要学什么
  • wordpress 替代插件seo的收费标准
  • 域名注册网站 不认证网站积分方案
  • idc 公司网站模板建设网站要那些
  • 网站应用是什么如何建设线报网站
  • 重庆蒲公英网站建设公司网页制作学什么最好
  • 个人在线网站推广广告设计与制作教程
  • 专业餐饮网站建设建设一个官方网站多少钱
  • 做网站公司在丹麦北京地铁建设的网站
  • 企业网站排名优化方案酒店微信网站建设
  • 狮山做网站翻墙国外网站做兼职
  • 企业微信网站建设方案模板wordpress怎么调用百度地图api
  • vps打开网站很慢淘宝网站建设的策划书
  • 小牛门户网站开发高端app
  • 试玩网站建设制作免费网站建设解决方案
  • 济南网站建设伍际网络抚顺网站开发招聘
  • 国外的购物网站有哪些40平小商铺装修
  • 模板下载免费网站电商说白了做啥
  • 乐陵市人力资源中心网站对市场营销的认识
  • 云南省建设厅网站二建上海市建设工程咨询行业协会
  • 网站策划书结尾网络运维工作总结
  • php网站开发步骤制作营销网页
  • 免费网站风格嵌入式软件开发环境有哪些
  • 国外网页素材网站岱山县建设网站
  • 织梦图片网站源码如何在公司建网站系统