如何配置,页面自动跳转?

直接在url输入www.fool.com 那么页面默认跳转到www.fool.com/index.htm,进而取用index.htm对应的控制器进行页面渲染。

那么,这个所谓"默认跳转"是如何实现的?怎么配置?我可能会想改一下。

这样写好像太水了,时间不太够,先列下:

  • apache下,是在/deploy/apache/conf/httpd-linux.conf中,配置:

RewriteRule ^/$ /index.htm [R,L]

<welcome-file-list>
<welcome-file>index.htm</welcome-file>
</welcome-file-list>

  • 正常的controller间,指定跳转:

return "redirect:/index.htm";

原文地址:https://www.cnblogs.com/alipayhutu/p/3045557.html