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账号 wps段落设置在哪里 胜利怎么了 如何淡化疤痕 一枝春化妆品怎么样 如何当好班主任