您的位置:首页 > 其它

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

2013-04-26 19:18 148 查看
直接在url输入www.fool.com 那么页面默认跳转到www.fool.com/index.htm,进而取用index.htm对应的控制器进行页面渲染。

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

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

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


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



tomcat下,是在assembly\template\src\main\resources\OSGI-INF\templates\web.xml中配置,

  http://wenku.baidu.com/view/49b8c0ec4afe04a1b071def0.html

   http://angrycoder.iteye.com/blog/919375

http://jackandroid.iteye.com/blog/545099

/article/1278772.html

http://www.ibm.com/developerworks/cn/java/j-velocity/


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



正常的controller间,指定跳转:


return "redirect:/index.htm";

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐