博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
SpringMVC+Maven+tomcat配置----2.tomcat的配置
阅读量:5082 次
发布时间:2019-06-13

本文共 4826 字,大约阅读时间需要 16 分钟。

------------ tomcat\conf\context.xml ---------------------------

 

<?xml version="1.0" encoding="UTF-8"?>

<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software

distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--><!-- The contents of this file will be loaded for each web application --><Context>

<!-- Default set of monitored resources -->

<WatchedResource>WEB-INF/web.xml</WatchedResource>

<!-- Uncomment this to disable session persistence across Tomcat restarts -->

<!--
<Manager pathname="" />
-->

<!-- Uncomment this to enable Comet connection tacking (provides events

on session expiration as well as webapp lifecycle) -->
<!--
<Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
-->
<!--
Caused by: java.lang.NoSuchMethodException: org.apache.catalina.deploy.WebXml addFilter
解决办法为:在tomcat目录下conf下的context.xml中添加<Loader delegate="true"/> 属性。
经过查询资料显示,该属性含义如下 。
True,表示tomcat将遵循JVM的delegate机制,即一个WebAppClassLoader在加载类文件时,会先递交给SharedClassLoader加载,SharedClassLoader无法加载成功,会继续向自己的父类委托,一直到BootstarpClassLoader,如果都没有加载成功,则最后由WebAppClassLoader自己进行加载。
False,表示将不遵循这个delegate机制,即WebAppClassLoader在加载类文件时,会优先自己尝试加载,如果加载失败,才会沿着继承链,依次委托父类加载。
-->
<Loader delegate="true"/>

</Context>

-----------------------------------------      tomcat\conf\tomcat-users.xml      -------------------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>

<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software

distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--><tomcat-users>
<!--
NOTE: By default, no user is included in the "manager-gui" role required
to operate the "/manager/html" web application. If you wish to use this app,
you must define such a user - the username and password are arbitrary. It is
strongly recommended that you do NOT use one of the users in the commented out
section below since they are intended for use with the examples web
application.
-->
<!--
NOTE: The sample user and role entries below are intended for use with the
examples web application. They are wrapped in a comment and thus are ignored
when reading this file. If you wish to configure these users for use with the
examples web application, do not forget to remove the <!.. ..> that surrounds
them. You will also need to set the passwords to something appropriate.
-->
<!--
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="<must-be-changed>" roles="tomcat"/>
<user username="both" password="<must-be-changed>" roles="tomcat,role1"/>
<user username="role1" password="<must-be-changed>" roles="role1"/>
-->

<role rolename="admin-gui"/>

<role rolename="admin-script"/>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<role rolename="maven"/>

<user username="admin" password="admin" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-script,admin-gui,maven"/>

<user username="maven" password="123456" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-script,admin-gui,maven"/>

</tomcat-users>

 

----------------------------------------  tomcat\conf\Catalina\localhost\manager.xml  -----------------------------------------

<?xml version="1.0" encoding="UTF-8"?>

<Context privileged="true" antiResourceLocking="false"
docBase="${catalina.home}/webapps/mavenDemo"
path="${catalina.home}/webapps/mavenDemo"
reloadable="true">
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$" />
</Context>

 

转载于:https://www.cnblogs.com/mzxl1987/p/7826303.html

你可能感兴趣的文章
字符串转化整数与回文数
查看>>
hammer使用: 代码:捏合、捏开、图片放大 的一个手机图片“放大缩小可拖动”的小效果...
查看>>
Java写的斗地主游戏源码
查看>>
[HEOI2016] 序列
查看>>
关于制作C语言头文件的思考
查看>>
SEH与虚函数
查看>>
AOP - 2 实例(SpringBoot 注解方式)
查看>>
编译和运行时的界限在哪儿?
查看>>
RequireJS进阶(三)
查看>>
NIO buffer 缓冲区 API
查看>>
实验2
查看>>
ubuntu下安装飞鸽传书
查看>>
淡入淡出文字垂直滚动
查看>>
freemarker对数字的处理
查看>>
云计算之路-Azure vs 阿里云:从负载均衡中摘/挂虚拟机
查看>>
HDU 1711: Number Sequence
查看>>
HDU 1754: I Hate It
查看>>
第9次Java作业+LSYang
查看>>
c# 了解c# 面向对象
查看>>
闭包的运用
查看>>