使用freemarker模板引擎
This commit is contained in:
Executable → Regular
+29
-28
@@ -1,29 +1,30 @@
|
|||||||
package com.didispace.web;
|
package com.didispace.web;
|
||||||
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.ui.ModelMap;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author 程序猿DD
|
* @author 程序猿DD
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
* @blog http://blog.didispace.com
|
* @blog http://blog.didispace.com
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
public class HelloController {
|
public class HelloController {
|
||||||
|
|
||||||
@RequestMapping("/hello")
|
@RequestMapping("/hello")
|
||||||
public String hello() {
|
@ResponseBody
|
||||||
return "Hello World";
|
public String hello() {
|
||||||
}
|
return "Hello World";
|
||||||
|
}
|
||||||
@RequestMapping("/")
|
|
||||||
public String index(ModelMap map) {
|
@RequestMapping("/")
|
||||||
map.addAttribute("host", "http://blog.didispace.com");
|
public String index(ModelMap map) {
|
||||||
return "index";
|
map.addAttribute("host", "http://blog.didispace.com");
|
||||||
}
|
return "index";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user