开发者

Spring, how do I set the file shown when / is hit?

With Spring MVC 3, when a user goes to http://localhost/myspringapp/ how do I decide wh开发者_如何学Goat page they will see? I currently get a 404.


You can set a mapping on a Controller:

@RequestMapping("/") @Controller
public class HomeController {
    @RequestMapping
    public String index() { /* your action */ }

You can also set a JSP file as welcome-file in your web.xml.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜