输入域名,localhost,直接跳转到controller的几种方式:

    xiaoxiao2025-11-08  16

    输入域名,localhost,直接跳转到controller的几种方式: (1),在web.xml中写如下         <welcome-file-list>         <welcome-file>welcome.html</welcome-file>     </welcome-file-list> 然后在建立welcome.html,在里面用js或者jsp的request,response方式,或者<meta http-equiv="refresh" content="0; url=index.d"> (2)或者在<welcome-file-list>         <welcome-file>index.d</welcome-file>     </welcome-file-list> 然后建立一个空的index.d文件,最后要保证index.d的controller要存在,这样就直接跳转到index.d的controller。 (3)使用spring mvc或者是struts的xml中配置默认跳转地址
    最新回复(0)