首页>代码>Spring Boot整合thymeleaf做为显示层的hello world实例>/springboot-thymeleaf-helloworld/src/main/java/com/hellokoding/springboot/view/HelloController.java
package com.hellokoding.springboot.view; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; @Controller public class HelloController { @GetMapping({"/", "/hello"}) public String hello(Model model, @RequestParam(value="name", required=false, defaultValue="World") String name) { model.addAttribute("name", name); return "hello"; } }
最近下载更多
黄小熙 LV7
2023年10月13日
ewan007 LV29
2023年7月7日
levmar LV12
2023年1月12日
lyd19931203 LV21
2021年6月22日
SYX__0707 LV6
2021年4月6日
xiaokang1 LV9
2020年12月30日
tywerqui LV3
2020年12月24日
13165798872 LV11
2020年12月14日
木杉123456 LV6
2020年11月12日