首页 > Web开发 > 详细

webwork或Struts配置网站根路径的默认页面办法

时间:2015-11-27 17:12:33      阅读:298      评论:0      收藏:0      [点我收藏+]

参考资料:http://www.iteye.com/problems/24028

查阅好多资料,关于webwork或Struts处理默认页面的方式,能否像spring MVC那样直接指定默认访问页面。非要在web.xml中配置welcome-file。

也许是我愚钝,还未掌握其精髓。又也许是我习惯了spring MVC。反正我很讨厌webwork或Struts的对默认页面的做法。

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

既然这样,没有办法了,在根目录下方个index.htm静态文件,书写如下内容:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>  
<head>  
<meta    http-equiv="Content-Type"    content="text/html; charset=UTF-8" />
<meta    http-equiv="expires"    content="Mon, 06 Jan 1990 00:00:01 GMT" />
<meta    http-equiv="refresh"    content="0;url=index.action"/>  
</head>  
</html>

其中url=index.action是想要跳转的动态地址。像我做手机页面的就是wap.html2(外包公司搞了个html2的奇葩后缀^_^)。

先这么用着。

webwork或Struts配置网站根路径的默认页面办法

原文:http://www.cnblogs.com/luodengxiong/p/5000843.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!