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如何往前台传递参数
热门搜索
关于感恩手抄报 讲文明懂礼貌手抄报 节俭养德手抄报 创卫手抄报图片 安全文明手抄报图片 一年级小学生手抄报 快乐手抄报 红军长征手抄报 感恩亲情手抄报 手抄报的内容