Skip to content

Commit 8c0b412

Browse files
committed
使用velocity渲染web视图
1 parent 7eab9c3 commit 8c0b412

File tree

1 file changed

+29
-28
lines changed

1 file changed

+29
-28
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
1-
package com.didispace.web;
2-
3-
import org.springframework.stereotype.Controller;
4-
import org.springframework.ui.ModelMap;
5-
import org.springframework.web.bind.annotation.RequestMapping;
6-
import org.springframework.web.bind.annotation.RestController;
7-
8-
/**
9-
*
10-
* @author 程序猿DD
11-
* @version 1.0.0
12-
* @blog http://blog.didispace.com
13-
*
14-
*/
15-
@Controller
16-
public class HelloController {
17-
18-
@RequestMapping("/hello")
19-
public String hello() {
20-
return "Hello World";
21-
}
22-
23-
@RequestMapping("/")
24-
public String index(ModelMap map) {
25-
map.addAttribute("host", "http://blog.didispace.com");
26-
return "index";
27-
}
28-
1+
package com.didispace.web;
2+
3+
import org.springframework.stereotype.Controller;
4+
import org.springframework.ui.ModelMap;
5+
import org.springframework.web.bind.annotation.RequestMapping;
6+
import org.springframework.web.bind.annotation.RestController;
7+
8+
/**
9+
*
10+
* @author 程序猿DD
11+
* @version 1.0.0
12+
* @blog http://blog.didispace.com
13+
*
14+
*/
15+
@Controller
16+
public class HelloController {
17+
18+
@RequestMapping("/hello")
19+
@ResponseBody
20+
public String hello() {
21+
return "Hello World";
22+
}
23+
24+
@RequestMapping("/")
25+
public String index(ModelMap map) {
26+
map.addAttribute("host", "http://blog.didispace.com");
27+
return "index";
28+
}
29+
2930
}

0 commit comments

Comments
 (0)