一想到默认首页,很多人可能首先想到的是在web.xml如下配置:

<welcome-file-list>
    <welcome-file>xxxx/xxx</welcome-file>
</welcome-file-list>

但是不好意思,不可以。最终的解决方法,在spring-mvc.xml文件中加入以下配置,测试问题解决(需要删除webapp下边的index.jsp文件,否则tomcat容器环境下依然会访问到这个文件)

<mvc:view-controller path="/" view-name="redirect:/xx/xxx" />

 

相关文章:

  • 2021-08-14
  • 2022-12-23
  • 2021-12-21
  • 2021-09-10
  • 2021-04-17
  • 2021-10-04
  • 2021-11-12
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案