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

Looking at JAVA Technology from the Angle of Operation and maintenance

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

1. JAVA technology 1.1. The composition of JAVA technology

Java is an object-oriented programming language developed by sun. It is one of the most widely used programming languages in the world.

The composition of Java technology:

JVM: Java virtual machine, provide Java running environment JAVA programming language: provide programmers to write code JAVA Class: Java class file format, determine the bytecode compiled by Java program should follow the specification, used to be compatible with different JVMJAVA API: provide Java API interface, shorten the application development cycle 1.2. JVM

JVM is the core and foundation of Java and the virtual processor (middle layer) between Java interpreter and OS platform. It is a kind of computer abstracted by software method based on operating system and hardware platform.

After the introduction of the Java virtual machine, there is no need to rewrite the Java language when running on different platforms, so that Java programmers only need to write code in the face of JVM when developing Java programs, regardless of the underlying operating system and hardware platform.

The Java language uses the Java virtual machine to shield the information related to the specific platform, so that the Java language compiler only needs to generate the target bytecode running on the Java virtual machine and can run on a variety of platforms without modification.

1.3. JDK

JDK is the software development kit of Java language and the core of the whole Java. It contains the running environment of Java and Java tools.

To put it simply, JDK = JAVA programming language + JAVA API + compiler + JVM

Classification of JDK

Java SE: standard Edition, is a version we usually use Java EE: enterprise Edition, using this JDK to develop J2EE applications Java ME: mainly used for mobile devices, embedded devices on Java applications 2. JAVA WEB program implementation 2.1. Applet class

Applet is written in Java programming language. After compilation, the applet program can be embedded in HTML, and then the applet program is sent to the client. The client browser can execute the applet program as long as the JDK plug-in is installed, and the results are displayed on the client side through the browser. This is the client dynamic website.

Disadvantages of client-side dynamic websites:

Need client to install JDK plug-in if applet is infected with virus, if this program runs on the client, it may cause great harm to the client host.

Because of these shortcomings, the concept of server-side dynamics emerged later.

2.2. Servlet class

Servlet is a server-side program written in Java. Its main function is to interactively browse and modify data and generate dynamic WEB resources.

Servlet allows Java language to develop dynamic WEB programs running on servers according to CGI technology, but the advantage of Java Servlet on servers with high traffic is that they execute faster than CGI programs.

Each user request in Servlet is activated as a thread in a single program without creating a separate process, which means that the overhead of processing requests on the server side will be significantly reduced.

The process of processing a request by Servlet:

The client sends the request to the server and the server sends the request information to ServletServlet to generate the response content and sends it to the server server to return the response to the client. 3. JSP

JSP is the server page of Java. It is a special class of Servlet and is basically a simplified Servlet design.

JSP is a program segment that inserts Java into a traditional HTML file, thus forming a JSP file.

A famous framework for developing JSP programs is SSH (Structs, Spring, Hebernate).

JSP implements the Java extension in HTML syntax, which is returned to the client by executing Java code on the server side and then embedding the execution result into HTML.

Servlet mainly realizes the development of WEB dynamic resources running on server side with Java language.

Most of these WEB dynamic resources developed according to the Java language are .jsp resources.

2.4. Servlet container and web container

Servlet Container contains functions that JDK and JDK do not have, which allows a Servlet to run with a corresponding Servlet process.

The Servlet process is responsible for receiving the request passed by the front-end CGI and processing it on the local JVM

Servlet is also responsible for monitoring whether the local .java program has been modified and recompiling the compiler into a .class file once the change occurs.

Web Container is a framework that includes Jasper and Servlet-related technologies, in which Jasper is responsible for monitoring whether local .jsp programs have been modified, replacing them with .java source code as required, and leaving .java to Servlet for processing.

Commercial implementation of Web Container: websphere, weblogic

Open source implementation of Web Container: tomcat, jetty

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

Servers

Wechat

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

12
Report