码迷,mamicode.com
首页 > 其他好文 > 详细

何让welcome-file跳转到Action呢[转]

时间:2017-05-01 00:26:23      阅读:296      评论:0      收藏:0      [点我收藏+]

标签:数据   tco   list   net   dex   设置   location   rip   log   

转自:http://blog.csdn.net/ytsmwhc/article/details/7256843
 

 

设置welcome-file跳到Action总是报404,因为需要在首页加载数据,需要进action,怎么办呢?

解决方法:

1.

welcome list 是可以设置xxxx.do的,只不过你要建一个相同名的空文件了 
比如你要让welcome list 指向index.do 
你在工程根目录下建个index.do的文件就行了,空的,什么都不用写 
tomcat的配置文件里面有说明,看看就明白了!

2.

指定一个页面再跳到action:

<welcome-file-list> 
<welcome-file>index.html </welcome-file> 
</welcome-file-list> 
index.html里面写: 
<body bgcolor="#FFFFFF" text="#000000"> 
<script language="JavaScript"> 
location.href = " <%=request.getContextPath()%>/newsmain.do" 
</script> 
</body>

 

何让welcome-file跳转到Action呢[转]

标签:数据   tco   list   net   dex   设置   location   rip   log   

原文地址:http://www.cnblogs.com/wyhgo/p/6790744.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!