📄 indexcontroller.java
字号:
package demo.web;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import java.util.Date;
/**
* Simple Index controller
* @version 1.0
*/
@Controller
public class IndexController {
@RequestMapping("/index.htm")
public ModelMap index() throws Exception {
ModelMap map = new ModelMap();
Date now = new Date();
map.addAttribute("date", now);
return map;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -