关于首页的设置一问

soundsoul 2006-02-28 12:35:55
用webwork搭建网站,希望整个网站能够不显示.jsp,而全部用.action后缀,其他都可以解决,现在问题是登陆首页的时候不知道该在哪里设置index.action
比如网站是http://www.cctv.com/
输入之后自动都会找到http://www.cctv.com/index.jsp这样形式的页面
现在想把这个index.jsp也屏蔽掉
使得输入之后出现的是:http://www.cctv.com/index.action
不知道是不是该在tomcat的web.xml里面配置还是在应用的WEB-INF/web.xml下面配置
也不知道该怎么配置
望指教
thx
...全文
97 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
doway 2006-02-28
  • 打赏
  • 举报
回复
<jsp:forward page="index.action" />

应该象上边这样转发一下。

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

这样的设置可能要求最新版本的应用服务器,在低版本的应用服务器上会有问题。
treeClimber 2006-02-28
  • 打赏
  • 举报
回复
<welcome-file-list>
<welcome-file>index.action</welcome-file>
</welcome-file-list>
doway 2006-02-28
  • 打赏
  • 举报
回复
>用的应用服务器是tomcat5.0,真的是不行啊
>是不是其他新一点版本的应用服务器可以解决啊?

新版本的应用服务器可以设置 welcome-file 到 Servlet,但前提是配置文件是不同的,要按 Servlet 2.4/JSP 2.0 配置。

楼主可以用 JBuilder 2006 建相应版本的 Web 模块,如果手工写,楼主应该 GOOGLE 一下:
web.xml servlet 2.4
剑事 2006-02-28
  • 打赏
  • 举报
回复
tomcat不能用servlet做 welcome-file

设置成了index.action tomcat是找不到的 因为目录里没有index.action这个文件



解决方法
1,可以在web目录里建立一个txt文件 改名index.action 就可以
2,welcome-file 设置为 index.htm 在index.htm转向到index.action

weblogic下就不会出现这个问题

wangx1949 2006-02-28
  • 打赏
  • 举报
回复
WEB-INF/web.xml下配置:<welcome-file-list>
<welcome-file>index.action</welcome-file>
</welcome-file-list>
soundsoul 2006-02-28
  • 打赏
  • 举报
回复
在WEB-INF/web.xml下配置:
<welcome-file-list>
<welcome-file>index.action</welcome-file>
</welcome-file-list>
这样的结果是访问地址得到的结果:
********************************************
Directory Listing For /
Filename Size Last Modified
.svn/ Tue, 24 Jan 2006 04:51:57 GMT
advanced.jsp 40.6 kb Mon, 23 Jan 2006 05:36:22 GMT
advancedResult.jsp
......
********************************************
用的应用服务器是tomcat5.0,真的是不行啊
是不是其他新一点版本的应用服务器可以解决啊?

转发是可以的,不过奇怪是不是只有转发才能解决...
  • 打赏
  • 举报
回复
在WEB-INF/web.xml下配置:<welcome-file-list>
<welcome-file>index.action</welcome-file>
</welcome-file-list>

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧