在我的控制器中:
@Controller
@RequestMapping(value="Main")
/*the methods */
@RequestMapping(value="/index.do", method = RequestMethod.GET)
在我的 web.xml 中:
<servlet-mapping>
<servlet-name>MyController</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>Main/index.do</welcome-file>
</welcome-file-list>
当我输入 :localhost/projectname/
时,它不会localhost/projectname/Main/index.do
像我预期的那样导致,并且在 Eclipse 的控制台中没有任何输出。
但是如果我尝试整个 URL localhost/projectname/Main/index.do
,控制器就会响应我想要的。
那么我应该如何配置我的欢迎文件列表呢?