0
在Spring MVC 3中,當用戶轉到http://localhost/myspringapp/時,我該如何決定他們將看到的頁面?目前,我得到一個404春天,如何設置當/被擊中時顯示的文件?
在Spring MVC 3中,當用戶轉到http://localhost/myspringapp/時,我該如何決定他們將看到的頁面?目前,我得到一個404春天,如何設置當/被擊中時顯示的文件?
您可在控制器設定的映射:
@RequestMapping("/") @Controller
public class HomeController {
@RequestMapping
public String index() { /* your action */ }
您還可以設置一個JSP文件爲welcome-file
在web.xml
。