如何让tomcat列出tomcat 配置web根目录录下的所有页面

博客分类:
*********************************1法
********************************************
在tomcat C:\Program Files\Apache Software
Foundation\Tomcat 6.0\conf
目录下的server.xml
&/Host&标签前
增加如下:
&Context path="" docBase="E:/Item/chs/WebRoot" debug="0"
reloadable="false" crossContext="true"&&/Context&
E:/Item/chs/WebRoot
你的项目路径,
输入http://localhost:8080/即可访问 ok!!
*********************************2法
********************************************
项目上右键Properties--MyEclipse--Web--Web
Context-root :/cang ---&/
(只一个斜杠)
即可访问 ok!!
浏览: 72497 次
来自: 成都
Ext.tip.QuickTipManager.in ...
还是不行啊!
jackyrong 写道如果有个url ,是要保护的资源url ...
如果有个url ,是要保护的资源url,为/abc/abc.a ...
&a href=&http://redston ...
(window.slotbydup=window.slotbydup || []).push({
id: '4773203',
container: s,
size: '200,200',
display: 'inlay-fix'通常情况下,Web项目是发布到Tomcat下的webapps文件目录下的 。以至于我们访问的时候:
&&& 例如:Web应用项目名称为:webManager,则部署到tomcat后,是部署在tomcat/webapps/webManager中,网址为:http://localhost:8080/webManager。
&然而 ,每当我们访问一个网站页面时,地址栏就是:/login.html。所以一般我们实际使用是不带webManager(也就是所谓的项目名称)的。
具体操作如下:
&&& 选中我们要操作的Web项目,单击右键,选择Properties ,则会出现
我们只需要把Web Context-root的值改为&/&。把webManger将其去掉就可以啦 。
我们就把项目webManger部署到Tomcat根目录下的ROOT文件夹里了 。
我们在访问的时候 ,就不需要把项目名称给带上了 。
阅读(...) 评论()2292人阅读
【tomcat】(19)
【Linux】(45)
1.tomcat原来的默认根目录是http://localhost:8080,如果想修改访问的根目录,可以这样:
找到tomcat的server.xml(在conf目录下),找到:
&Host name=&localhost& appBase=&webapps&
&&&&&& unpackWARs=&true& autoDeploy=&true&
&&&&&& xmlValidation=&false& xmlNamespaceAware=&false&&&/Host&
在&/Host&前插入:
&Context path=&& docBase=&D:/eclipse3.3/jb51.net/tomcat/& debug=&0&/&
其中D:/eclipse3.3/jb51.net/tomcat/就是我想设置的网站根目录,然后重启tomcat。
再次访问http://localhost:8080时,就是直接访问D:/eclipse3.3/jb51.net/tomcat/目录下的文件了。
2.tomcat的web.xml(在conf目录下),在该文件中找到
&&& &welcome-file-list&
&&&&&&& &welcome-file&index.html&/welcome-file&
&&&&&&& &welcome-file&index.htm&/welcome-file&
&&&&&&& &welcome-file&index.jsp&/welcome-file&
&&& &/welcome-file-list&
这是tomcat默认的3个文件,当你输入指定路径后,tomcat会自动查找这3个页面。如果你想让tomcat自动找到自己的页面,比如main.jsp。可以修改上面信息为:
&&& &welcome-file-list&
&&&&&&& &welcome-file&main.jsp&/welcome-file&
&&&&&&& &welcome-file&index.html&/welcome-file&
&&&&&&& &welcome-file&index.htm&/welcome-file&
&&&&&&& &welcome-file&index.jsp&/welcome-file&
&&& &/welcome-file-list&
这样就可以了。
&&相关文章推荐
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:242607次
积分:5300
积分:5300
排名:第5472名
原创:201篇
转载:422篇
评论:62条
(2)(36)(8)(11)(8)(4)(4)(3)(3)(31)(30)(35)(73)(73)(40)(14)(14)(24)(50)(2)(2)(8)(3)(5)(7)(9)(5)(2)(2)(4)(19)(17)(9)(5)(15)(23)(24)
(window.slotbydup = window.slotbydup || []).push({
id: '4740887',
container: s,
size: '250,250',
display: 'inlay-fix'Tomcat中更改网站根目录和默认页的配置方法
字体:[ ] 类型:转载 时间:
这篇文章主要介绍了Tomcat中更改网站根目录和默认页的配置方法,需要的朋友可以参考下
1.tomcat原来的默认根目录是http://localhost:8080,如果想修改访问的根目录,可以这样:
找到tomcat的server.xml(在conf目录下),找到: 代码如下:&Host name="localhost" appBase="webapps"&&&&&& unpackWARs="true" autoDeploy="true"&&&&&& xmlValidation="false" xmlNamespaceAware="false"&&/Host&在&/Host&前插入:
代码如下:&Context path="" docBase="D:/eclipse3.3/jb51.net/tomcat/" debug="0"/&
其中D:/eclipse3.3/jb51.net/tomcat/就是我想设置的网站根目录,然后重启tomcat。
再次访问http://localhost:8080时,就是直接访问D:/eclipse3.3/jb51.net/tomcat/目录下的文件了。
2.tomcat的web.xml(在conf目录下),在该文件中找到 代码如下:
&&& &welcome-file-list&&&&&&&& &welcome-file&index.html&/welcome-file&&&&&&&& &welcome-file&index.htm&/welcome-file&&&&&&&& &welcome-file&index.jsp&/welcome-file&&&& &/welcome-file-list&
这是tomcat默认的3个文件,当你输入指定路径后,tomcat会自动查找这3个页面。如果你想让tomcat自动找到自己的页面,比如main.jsp。可以修改上面信息为: 代码如下:
&&& &welcome-file-list&&&&&&&& &welcome-file&main.jsp&/welcome-file&&&&&&&& &welcome-file&index.html&/welcome-file&&&&&&&& &welcome-file&index.htm&/welcome-file&&&&&&&& &welcome-file&index.jsp&/welcome-file&&&& &/welcome-file-list&&&& 这样就可以了。
您可能感兴趣的文章:
大家感兴趣的内容
12345678910
最近更新的内容
常用在线小工具}

我要回帖

更多关于 tomcat 根目录 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信