Tomcat ???? ?? ??: ?? ??? ?
??
Apache Tomcat? ?? ?? ???? Java ? ?? ? ??? ???? ? ??? ? ?? ??? ?? ? ??????? ?????. ? ????? ???? ?? ?? ??? ???? ? ??? ??? Tomcat ????? ?? ???? ??? ?????.
??
-
???? ??????
-
???? ??
-
?? ????
-
?? ?? ??
-
?? ??
-
?? ??
-
???? ??????
1.1 ??
1999?? ?? ??? Tomcat? ??? ?? ?? ????? ?? ?? ??? Tomcat 11.0???.
1.2 ??? ??
- ???
- ??? ???? ??
- JSP ??
- ??? ??
-
???? ??
2.1 ?? ????
<code>// Tomcat 架構(gòu)的簡(jiǎn)化表示 服務(wù)器 (頂級(jí)容器) └── 服務(wù) ├── 連接器 (HTTP/AJP) └── 容器 (引擎) └── 主機(jī) └── 上下文 └── 包裝器</code>
2.2 ?? ??? ??
- ??? ???
- ??
- ???? ?? ????
- ???
-
?? ?? ??
3.1 ?? ????
public interface Server { // 主要服務(wù)器組件 public Service[] findServices(); public void addService(Service service); public void removeService(Service service); }
3.2 ??? ????
public interface Service { // 將一個(gè)或多個(gè)連接器與容器組合 public Container getContainer(); public void setContainer(Container container); public Connector[] findConnectors(); }
3.3 ??? ???
public interface Connector { // 處理與客戶端的通信 public void setPort(int port); public void setProtocol(String protocol); public Container getContainer(); }
3.4 ???? ??
- ??
- ???
- ????
- ??
-
?? ?? ??
4.1?? ????
- ?????? HTTP ??? ????
- ???? ??? ???? ?????
- ??? ???? ?????? ?????
- ???? ??? ?????
- ??? ??? ?? ??? ?????
// 簡(jiǎn)化的請(qǐng)求處理流程 public class RequestProcessor { public void process(Request request, Response response) { // 1. 解析 HTTP 請(qǐng)求 connector.parse(request); // 2. 創(chuàng)建請(qǐng)求/響應(yīng)對(duì)象 Request req = new Request(request); Response res = new Response(response); // 3. 通過容器管道處理 container.getPipeline().invoke(req, res); // 4. 發(fā)送響應(yīng) response.send(); } }
-
?? ??
5.1 ???? ??
public interface Lifecycle { public void init(); public void start(); public void stop(); public void destroy(); }
5.2 ???-?? ????
public interface Pipeline { public Valve getBasic(); public void setBasic(Valve valve); public void addValve(Valve valve); }
5.3 ??? ??
- ? ?????? ??? ??
- ?? ??? ??
- ??? ??? ??
-
?? ??
6.1 ?? ???
<server port="8005" shutdown="SHUTDOWN"><service name="Catalina"><connector port="8080" protocol="HTTP/1.1"></connector><engine defaulthost="localhost" name="Catalina"><host appbase="webapps" name="localhost"></host></engine></service></server>
6.2 ?? ???
- ??? ??? ? ??
- ??? ??
- ?? ?? ?? ??
??
Tomcat? ????? ???? ?? ? ??????? ???? Java ????? ?? ?????. ? ??? ??? ???:
- ???? ?????? ??
- ?? ???
- ??? ???? ??
????
- Apache Tomcat ?? ??
- EJB ?? ???? 1:1 J2EE ??
- Tomcat: ?? ???
? ??? Tomcat ???? ??? - ?? ? ?? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ??











?? ?? ?? ??? ??? ?? ??? ??, ? ? ?? ? ??? ?????. 1. ??? ?? ???? ?? ???? ???-????, ? ??? ??? ??? ? ????, Hashmap? ???-??? ?? ??? ??? ???? ????. 2. NULL ? ?? ???? HashMap? ??? NULL ?? ?? ? ?? ???? ?? HashTable? NULL ?? ?? ???? ??? NullPointerException? ?????. 3. ????? ??? ????? ?? ??? ?? ?? ? ????? HashTable? ? ??? ?? ?? ??? ????. ?? ConcurrenTashMap? ???? ?? ????.

Java? ?? ??? ??? ?? ??? ??? ?? ??? ??? ?? ??? ?? ?? ??? ???? ??? ?? ???? ?????. 1. ??? ???? ??? ?? ?? ? ???? ?? ??? ???? ?? ?? ??? ? ????. 2. ???? ?? ??? ???? ??? ?? ???? ?? ?? ??? ???????. 3. ?? ???? ?? ?? ?? ? ???? ???? ?? NULL ?? ??? ? ????. 4. ?? ???? ??? ?? ?? ? ??? ?????? ?? ??? ??? ?? ?? ??? ????? ??? ??? ??? ??????? ?? ???? ??????.

staticmethodsininterfaceswereIntRectionSelffacesswithinteffaceswithinteffaceswithintintinjava8toallowutilityFunctionswithinterfaceitswithinteffaceswithinterfaceffaces

JIT ????? ??? ???, ??? ?? ? ???, ?? ?? ? ???? ? ? ?? ?? ??? ? ?? ??? ?? ??? ??????. 1. ??? ???? ?? ?? ??? ??? ?? ?? ???? ??? ?? ?????. 2. ??? ?? ? ??? ?? ?? ? ??? ???? ?? ?? ???; 3. ?? ??? ??? ?? ??? ???? ???? ???? ? ?? ?? ??? ?????. 4. ?? ??? ?? ??? ??? ???? ???? ?? ? ??? ???? ?? ??? ?????.

???? ??? ??? Java?? ??? ?? ???? ??? ?? ? ? ??? ??? ???? ? ?????. ?? ???? ??? ??, ??? ?? ??? ?? ?? ??? ??? ????? ???? ????? ?????. ?? ??? ??? ??, ????? ? ??? ????, ?? ??? ??? ?????? ? ?? ? ?? ?????.

injava, thefinalkeywordpreventsavariable'svalue'svalueffrombeingchangedafterassignment, butitsbehaviordiffersforprimitivesandobjectreences.forprimitivevariables, asinfinalintmax_speed = 100; wherereassoncesanerror.forobjectref

??? ??? ?? ?? ??? ????? ? ???? ????? ???? ?? ???? ?? ???? ?????. ?? ??? ??? ????. ?? ?? ?? ??? ???? ???? ?? ?? ??? ??? ?? ?? ??? ??? ?????. ?? ??? ??? ????. ?? ??? ?? ??? ?? ?? ??? ?? ?? ??? ???? NewClass ()? ??? ?? ???? ????. ?? ??? ?? ??? ???? ?? ??? ?? ? ? ??? ?? ?? ??? ????? ????? ?????. ?? ??, ?? ?????? ?????, ??? ? ?? ????? ??? ?? ?????. ???? ?? ?? ??? ???? ?? ???? ?? ? ??? ???? ?? ??? ?? ?????? ?????. ???? ???? ??? ??, ?? ?? ? ?? ??? ????, ?? ?? ???? ?????.

??? ? ?? ??? ???? : ????? ?? ?. 1. int? ???? ???? ?? ?? ?? ? ??? ???? ?????. 2. ?? ? ???? (int) myDouble ??? ?? ?? ??? ?????. ?? ??? ??? ?? ??? ?? ??, ?? ?? ?? ???? ?? ??? ?? ???? ?? ?????. ???? ? ??? ??? ????. ?? ??? ??? ??? ??? ??? ?? ??? ??? ? ??? ?? ???? ??? ??? ??? ??? ? ??? ?? ??? ?? ??? ?? ?? ? ? ????. ?? ?? ??? ?? ??? ??? ??? ??? ? ??????.
