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如何往前台传递参数
热门搜索
偷东西怎么判刑 胃痛怎么办 qq亲密度怎么算的 惠普打印机怎么安装 被油烫伤怎么处理 墨鱼干怎么做好吃 word怎么插入目录 运满满怎么样 穿成大佬姨娘怎么破 奶豆腐怎么吃