SpringMVC如何往前台传递参数

 时间:2024-10-14 21:25:49

1、package web.controller;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpSession;import org.springframework.stereotype.Controller;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RequestMethod;@Controllerpublic class HomeController { @RequestMapping(value = "home", method = RequestMethod.GET) public String home(HttpSession session,HttpServletRequest request) { session.setAttribute("a", 1); request.setAttribute("b", 2); return "home"; }}

SpringMVC如何往前台传递参数
热门搜索
缺锌怎么补 囧怎么读 马騳骉怎么读 辞职后社保怎么处理 白细胞高是怎么回事 我的世界怎么种甘蔗 伊利奶粉怎么样 日语我爱你怎么说 怎么让嘴唇变薄 阿里斯顿热水器怎么样