首页>代码>spring boot整合freemarker做为显示层的hello world实例>/springboot-freemarker-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"; } }
最近浏览更多
微信网友_6261570828210176 LV1
2022年12月14日
vinsong
2021年4月29日
暂无贡献等级
1qw23456 LV10
2021年4月17日
snowing_for LV8
2021年4月13日
undefined LV1
2021年4月9日
xb1406112453 LV5
2021年2月25日
geek-zyx LV4
2021年2月21日
咪咕看见小黑 LV4
2021年1月14日
renjunyou LV10
2020年12月21日
18728748707 LV13
2020年12月4日