tomcat配置映射路径404不生效问题速记

配置方法

	##tomcat->conf->server.xml
	<Host><Context docBase="D:/images" path="/img"/></Host>
	## docBase 为物理路径  path 为需要映射到打开的路径

目前遇到共三个问题 (记得重新启动tomcat)

1. path与docBase路径名称不能一致

这个问题没有试,网上都说名称不可以,所以后续待验证,这里列出

2. 同级目录下web.xml 修改

	<!--false 变为true -->
		<init-param>
            <param-name>listings</param-name>
            <param-value>true</param-value>
        </init-param>

3. 以上都试过了且是使用idea启动项目无反应

打开编辑页面,将图片位置勾选上,重新启动

在这里插入图片描述
找了下官方的原文

The Tomcat configuration files, among other things, may list the applications that should be deployed at the server start. If this check box is selected,all the applications so listed will be deployed on the server in addition to the artifacts specified on the Deployment tab. If the check box is notselected, only the artifacts and the external resources specified onthe Deployment tab will be deployed.

配置文件可能会列出应该在服务器启动时部署的应用程序。 如果选中此复选框,则除了在“部署”选项卡上指定的构件外,还将在服务器上部署如此列出的所有应用程序。如果未选中该复选框 则仅部署部署选项卡上指定的工件和外部资源。

简单理解下,如果没有勾选,即没有必要去使用则只启动基本的工作和外部资源,以达到减少内存消耗的目的,反之,则启动所有支持的服务程序
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值