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如何往前台传递参数
热门搜索
如何快速瘦大腿 如何搭讪 mg怎么样 我的五年私奴生活 爱亲母婴生活馆 hpv病毒是什么 ppt图表怎么做 可转债如何转股 怎么重置无线路由器 鱼子怎么吃