Understanding the 1--java system of the first knowledge of Tomcat

Source: Internet
Author: User

First, preface
As a web Container developed by the Java language, Tomcat is often encountered in many applications, and its features are in line with the Java language's "one-compile-all-in-place" advantage, which requires a certain understanding of Java's technical architecture before introducing Tomcat.
Second, Java Introduction
Java, like Python, PHP, C #, is the application-level development language, different from the C system and the development language, the application-level development language on the same platform, the code written on the other platform can not run, which in the early days so many applications have to do a separate development for each platform. In the computer field, there is no two layers in the interface between the introduction of the middle layer to solve this problem, Java is no exception, it added a middle layer between the system and the application to solve the problem, the middle tier is responsible for dealing with different underlying systems, export to a unified Java class library (also become Java API , in the form of Xxx.class), the host can run all applications developed by the Java language as soon as the middle tier is installed.
Iii. JRE, JVM, and JDK
As I learned from the previous article, the middle tier is actually providing an environment for the Java language program to run, which is often referred to as the JRE (Java Run Environment), the core of which is a Java Virtual machine JVM (Java Vsan Machine), the JVM provides the class files required by the Java program to run, but only the JVM does not necessarily be able to execute the Java program, which requires the Java program to run as follows:
1. Code that will be developed in the Java language (usually Java code is packaged in the. jar directory) by compiling the program's class file
2. The ClassLoader in the JVM (CALSS loader) will compile the class file and call the class file (similar to the C language, the Java language also has a lot of public class files) to complete the load after the execution engine execution

3. The role of the execution engine is to convert a Java program to a local library call, enabling the Java program to run locally

A JVM is not necessarily able to execute Java programs because Java programs sometimes need to invoke other libraries during execution, so the JVM is a subset of the JRE, and the JDK is based on the JRE, where the JRE is a subset of the JDK.

Iv. Classification and CGI specification for Java
Java itself is divided into three genres: J2se (Java 2 standard Edition), Java EE (2 Enterprise Edition), J2ME (Java 2 Mobile Edition), except for the j2me of fresh people, J2SE and Java EE have been used in the production environment.
With the rise of dynamic content, the CGI specification is applied to almost all web scenes, CGI is the specification of the Web Server Runtime external program, according to CGI program can extend the function of the server, CGI program can also interact with the browser.
When an early client initiates a Java dynamic content request, the server sends the Java applet applet as a separate file to the client, and the Java applet typically renders the final result to the user after the client is running locally, called client dynamics. The advantage of this technique is that it reduces the load on the server, and the disadvantage is that if a malicious program is returned, the client is at great risk.
It is because of the client dynamic existence of many hidden dangers, instead of server-side dynamic, when the client initiates a Java dynamic content request, the server received a request to the server-side Java servlet program run, Java The servlet then returns the results of the run to the server and finally renders it to the user, thus avoiding the client-side dynamic situation.
Unlike PHP, which can be embedded directly into an HTML document, the results of the servlet are initially formatted as HTML documents in hard-coded format, which requires developers to master both the Java and HTML languages, so in order to reduce the developer's difficulty, The JSP program formats the results of the run as HTML documents, thus reducing the developer's threshold. The servlet is processed to the JSP program before it is formatted into HTML and then to the server for feedback to the user.
V. The distinction between J2SE and the Java EE
Functionally, you can think of it this way: J2SE only implements the functionality of the JDK, and he provides a container for Java applications. Java EE, which has JSP, Servlet, EJB, JMS, JavaMail, and so on, provides a web container to receive CGI or HTTP requests from clients.
Sun is open source for the JDK before it is acquired by Oracle, but the associated JSP, servlet and other components are not open source, and many commercial or community organizations offer a multitude of web container technologies, such as Websphere,weblogic,tomcat.

Understanding the 1--java system of the first knowledge of Tomcat

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.