Jsp空间中访问的时候必须要加文件名称才能访问的解决办法
2013/5/6 8:27:57 | 阅7621 | 来源:好空间网络 [打印] [关闭] |
?xml:namespace>
问题描述: 我的域名是 http://www.jspkongjian.net
我现在访问我的域名直接输入http://www.jspkongjian.net 他显示404 ,
必须要输入http://www.jspkongjian.net/index.htm 才可以正常,
我想成为只输入域名后面的文件名称不用输入就可以访问我的主页,.
就是浏览器中地址栏只显示http://www.jspkongjian.net
这个要怎么解决呢?
问题的解决办法:
1: 修改自己工程下的WEB-INF/web.xml文件,在里面增加上默认访问顺序
在<web-app>和</web-app>中间增加
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
这样一段话就可以了!!!
这个是工程的默认访问主页顺序页的设置,默认访问index.html 如果这个文件不存在他就访问第二个inddex.htm 如果第二个也不存在他就访问第三个..如此类推!!!
2:在会员管理中心,有个高级管理里有个默认访问顺序页设置,在里面设置默认访问主页的地方增加 index.htm,index.html,index.jsp 这样即可!
具体可以看:http://www.jspkongjian.net/news.jsp?id=548
如果您同时设置了自己工程下的web.xml也设置了我们高级管理里默认的,那么以您web.xml里的为准! 我们后台的默认访问顺序页的优先级没有您自己web.xml里的高!!!
在说下在做修改前请做好备份在修改!!!