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如何往前台传递参数
热门搜索
土豆红烧肉的做法 金华火腿的家常做法 怎么确认是排卵期出血 酱骨架的家常做法 椒盐鸡翅的做法 山药的做法大全 电脑锁屏密码怎么设置 苟怎么读 灵芝怎么吃 炖鸽子汤的做法