首页>代码>Spring boot学习资料,含:视图解析,数据库操作,安全机制,二维码,mail,定时任务,异常处理,配置日志>/springbootM/src/main/java/com/sbm/wll/controller/ReturnJSPController.java
package com.sbm.wll.controller; /** * 返回JSP页面,需要在application。properties设置,请看文档 */ import java.util.Date; import java.util.Map; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import com.sbm.wll.entity.School; import com.sbm.wll.entity.User; @Controller public class ReturnJSPController { @Value("${hello}") // 从配置文件中获取自定义属性的值 String hello; @RequestMapping("/hellojsp") public String helloJsp(Map<String, Object> map, HttpServletRequest req) { System.out.println("HelloController.helloJsp().hello=" + hello); map.put("hello", hello); User u = new User(); //req.setAttribute("user", new User(1, "老王",)); return "welcome"; } }

lironggang LV38
2023年3月14日
szy0077 LV4
2022年12月8日
17558420274 LV16
2021年8月14日
wyx065747 LV67
2021年7月9日
lipanknight LV4
2021年3月30日
13043860zj LV16
2021年1月29日
lovejing LV7
2020年7月24日
zaizai21312 LV10
2020年6月12日
13072368302 LV8
2020年5月11日
flyingli LV8
2020年5月6日