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如何往前台传递参数
热门搜索
庙湾岛旅游攻略 佳木斯旅游学校 四月份去哪旅游 日本旅游景点介绍 三亚亚龙湾旅游攻略 草原旅游景点 云南香格里拉旅游攻略 旅游同行 夏天去哪旅游好 湖北旅游政务网