Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the tomcat source structure?

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

Today, I will talk to you about what the tomcat source code structure is. Maybe many people don't know much about it. In order to let everyone know more, Xiaobian summarizes the following contents for everyone. I hope everyone can gain something according to this article.

Use idea to pull the source code locally, switch the branch, and now the directory structure should look like this:

You can see that this is an ant-based project, so let's right-click on build.xml and

Add as Ant Build File

From the ant task list on the right, we can see that there is a task named ide-intellij, and we can find this target in build.xml to see the relevant description:

We follow the instructions to configure environment variables and build packages

Then run ide-intellij, and the project downloads packages and so on, and when it's done,

directory structure

Now look at the code directory, the code should all be in the java directory, we will mark the java directory as the source code directory

Here, we can see tomcat top several modules, here first introduce their role, implementation and so on later we learn together

Catalina

Catalina is a Servlet container implementation provided by Tomcat, responsible for processing requests from clients and outputting responses.

There are Server ,Service ,Connector,Container, Engine,Host,Context,Wrapper,Executor , these concepts, now the knife only looked at the general, the next time we learn Catalina to look at these

Coyote

Coyote is the name of the Tomcat linker framework, an external interface provided by the Tomcat server for clients to access, and clients communicate with Catalina containers through Coyote. We are familiar with Request, Response is from the Coyote module

Coyota converts Socket input into Request object and gives it to Catalina, then Catalina processes it and then converts it into Response and returns it to Coyota.

el

Expression Language, java expression language, this corresponds to those values in our jsp, because now we are either separated from the front and back of the page, or use template languages such as freemarker , thymeleaf , so this can be how in-depth, then we will have a rough look

jasper

Tomcat jsp engine, we can introduce a variety of tags in jsp, in the case of not restarting the server, detect whether jsp pages have been updated, etc., or the above sentence, now before and after the separation is more, later learning, we also focus on Catalina and Coyota above.

jui ,naming ,tomcat

Let's talk about these three together.

Jui is a journal related

naming is a namespace,JNDI, API for Java directory services,JAVA applications can find data and objects by name through JNDI API, commonly used are: 1. Connect the application to an external service, such as a database. 2. Servlet looks up configuration information provided by WEB container through JNDI

tomcat is some additional features, such as websocket, etc

After reading the above, do you have any further understanding of what tomcat source code structure is? If you still want to know more knowledge or related content, please pay attention to the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report