tomcat初始化类加载Word文档格式.docx

上传人:b****4 文档编号:13704035 上传时间:2022-10-12 格式:DOCX 页数:27 大小:38.92KB
下载 相关 举报
tomcat初始化类加载Word文档格式.docx_第1页
第1页 / 共27页
tomcat初始化类加载Word文档格式.docx_第2页
第2页 / 共27页
tomcat初始化类加载Word文档格式.docx_第3页
第3页 / 共27页
tomcat初始化类加载Word文档格式.docx_第4页
第4页 / 共27页
tomcat初始化类加载Word文档格式.docx_第5页
第5页 / 共27页
点击查看更多>>
下载资源
资源描述

tomcat初始化类加载Word文档格式.docx

《tomcat初始化类加载Word文档格式.docx》由会员分享,可在线阅读,更多相关《tomcat初始化类加载Word文档格式.docx(27页珍藏版)》请在冰豆网上搜索。

tomcat初始化类加载Word文档格式.docx

 

∙Tomcat5.5.26源代码分析——启动过程

(二)

∙Tomcat源代码分析之ClassLoader

∙《HowTomcatWorks》翻译(7)之Tomcat类加载器续集

推荐群组:

Tapestry

更多相关推荐

Java综合

之前有写过关于tomcat中常用的一些类结构的文章。

解析Tomcat之HttpServlet(截图记录)

今天来关注一下,tomcat的类加载器相关的内容。

PS:

由于前一篇文章内容比较简单,有朋友冠以我标题党之嫌,对于此种说法,本人深感抱歉,可能标题确实有点大,但是这些常用的类,我更多的时候只关注其用法,而忽略了内部实现,所以也就把这些内容总结了一下,发了出来。

别无标题党之意,请各位eyer海涵。

OK,现在进入正题.Tomcat类加载器初始化.

开始之前,我们首先需要了解一下几个基本的知识点;

1.tomcat中类加载器的结构与关系。

这里,我引用tomcat文档的一个简图来说明一下,有兴趣深究的朋友,可以去翻看tomcat的文档,理解更多信息.

(tomcat5.5)

(由于参考的是tomcat6.0的源代码,这里纠正一下类加载器的图(如下),以免给别的朋友造成误解,同时也多谢asialee给出的提醒)

(tomcat6.0)

2.每种类加载器分别加载什么资源:

这些内容,可以在tomcat文档的 

ClassLoaderHOW-TO找到.

这里我要说明的是,在tomcat中,这些内容是记录在哪里的。

既(程序怎么让tomcat知道,需要加载哪些类)

答案是-----

其通过一个配置文件来指定的:

(catalina.properties),这个文件默认存放在

tomcat路径下的bin/bootstrap.jar中。

如图

打开文件,其内容如下:

Java代码 

1.# 

Licensed 

to 

the 

Apache 

Software 

Foundation 

(ASF) 

under 

one 

or 

more 

2.# 

contributor 

license 

agreements. 

See 

NOTICE 

file 

distributed 

with 

3.# 

this 

work 

for 

additional 

information 

regarding 

copyright 

ownership. 

4.# 

The 

ASF 

licenses 

You 

License, 

Version 

2.0 

5.# 

(the 

"

License"

);

you 

may 

not 

use 

except 

in 

compliance 

6.# 

License. 

obtain 

copy 

of 

License 

at 

7.# 

8.# 

/LICENSE-2.0 

9.# 

10.# 

Unless 

required 

by 

applicable 

law 

agreed 

writing, 

software 

11.# 

is 

on 

an 

AS 

IS"

BASIS, 

12.# 

WITHOUT 

WARRANTIES 

OR 

CONDITIONS 

OF 

ANY 

KIND, 

either 

express 

implied. 

13.# 

specific 

language 

governing 

permissions 

and 

14.# 

limitations 

License. 

15.# 

16.# 

List 

comma-separated 

packages 

that 

start 

with 

equal 

string 

17.# 

will 

cause 

security 

exception 

be 

thrown 

when 

18.# 

passed 

checkPackageAccess 

unless 

the 

19.# 

corresponding 

RuntimePermission 

("

accessClassInPackage."

+package) 

has 

20.# 

been 

granted. 

21.package.access=sun.,,,,,sun.beans. 

22.# 

23.# 

24.# 

25.# 

checkPackageDefinition 

26.# 

defineClassInPackage."

27.# 

28.# 

29.# 

default, 

no 

are 

restricted 

definition, 

and 

none 

of 

30.# 

class 

loaders 

supplied 

JDK 

call 

checkPackageDefinition. 

31.# 

32.package.definition=sun.,java.,,,, 

33.# 

34.# 

35.# 

paths 

defining 

contents 

common"

36.# 

classloader. 

Prefixes 

should 

used 

define 

what 

repository 

type. 

37.# 

Path 

relative 

CATALINA_HOME 

CATALINA_BASE 

path 

absolute. 

38.# 

If 

left 

as 

blank,the 

JVM 

system 

loader 

Catalina'

39.# 

loader. 

40.# 

Examples:

41.# 

foo"

:

Add 

folder 

repository 

42.# 

foo/*.jar"

all 

JARs 

specified 

43.# 

repositories 

44.# 

foo/bar.jar"

bar.jar 

45.common.loader=${catalina.home}/lib,${catalina.home}/lib/*.jar 

46.# 

47.# 

server"

48.# 

49.# 

50.# 

blank, 

51.# 

52.# 

53.# 

54.# 

55.# 

56.# 

57.server.loader= 

58.# 

59.# 

shared"

60.# 

61.# 

absolute. 

blank, 

62.# 

63.# 

64.# 

65.# 

66.# 

67.# 

68.# 

Please 

note 

single 

jars, 

e.g. 

bar.jar, 

need 

URL 

form 

69.# 

starting 

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 初中教育 > 其它课程

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1