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如何往前台传递参数
热门搜索
十万个为什么冷笑话 苹果6s怎么截图 为什么会掉头发 焉怎么读 离职申请书怎么写 高血压头晕怎么办最快最有效 泰拉瑞亚肉山怎么召唤 花肌粹护肤品怎么样 为什么要离开我 腰花的做法大全