1. JAVA technology
1.1. Composition JAVA technology
Java
Is an object-oriented programming language developed by sun
the research and development company, is one of the world's most widely used programming language
Java
Technical composition:
JVM
:Java
Virtual machine, providingJava
the runtime environmentJAVA 编程语言
: Available to the programmer to write codeJAVA Class
: Java class file format, decided toJava
compile a bytecode should follow the specifications for compatibility of differentJVM
JAVA API
: ProvidesJava
theAPI
interface to shorten the development cycle of the application
1.2. JVM
JVM
Is Java
the core and the foundation, is Java
interpreter and OS
virtual processors (intermediate layer) between the platform, which is based on computer operating systems and hardware platforms using software methods abstracted
introduced into Java
the virtual machine, such Java
languages on different platforms do not need to re-compiled runtime; so that Java
programmers in the development of Java
the program only to face JVM
writing code, do not care about the underlying operating system and hardware platform Java
language Java
virtual machine shield the information related to a specific platform, so that the Java
language compiler only must generate the Java
target byte code running on the virtual machine can run without modification on multiple platforms
1.3. JDK
JDK
It is the Java
language of the software development kit, the whole Java
core, which contains the Java
operating environment and Java
tools
it simply JDK = JAVA 编程语言 + JAVA API + 编译器 + JVM
classify the JDK
- Java SE: Standard Edition, a version we usually use
- Java EE: Enterprise Edition, using this
JDK
to developJ2EE
applications - Java ME: mainly used on mobile devices, embedded devices
Java
applications
2. JAVA WEB program realization
2.1. Applet class
applet
It is the use of Java
programming language, after compiled applet
program can be embedded to HTML
go, and then applet
send the program to the client, the client's browser as long as the installed JDK
plug-ins will be able to perform this applet
procedure, and the results displayed on the client browser this client is a dynamic site
A client's site Disadvantages:
- Client need to install
JDK
plug-ins - If
applet
a virus program if the client is running on the client host may have caused great harm
Because of these drawbacks it later emerged that the concept of server-side dynamic
2.2. Servlet class
Servlet
Is Java
a server-side programming, and its main function is to interactively view and modify data, generate dynamic WEB resources Servlet
can make Java
the language according to CGI
the dynamic server-side technology developed to run WEB
the program, but in heavy traffic server Java Servlet
advantage lies in their faster execution in CGI
the program Servlet
each user request is activated into a single-threaded program, without having to create a separate process, which means that overhead server processes the request will be significantly reduced
Servlet
Processing the request:
- Client sends a request to the server
- Request information to the server
Servlet
Servlet
Generating a response to the content server and pass it- The server will respond back to the client
2.3. JSP
JSP
Is Java
the server page, it is Servlet
a special class, is fundamentally a simplified Servlet
design JSP
in the traditional HTML
insert the file in Java
the block, thus forming a JSP
document
developed JSP
a well-known framework program it is to SSH(Structs, Spring, Hebernate)
JSP
achieve a HTML
syntax Java
extension, through on the server side Java
code is then embedded in the results HTML
returned to the client Servlet
is mainly achieved using Java
language developed to run at server
the end of WEB
the dynamic resources
which are based on Java
language development of WEB
most of the resources are dynamic .jsp
resources
2.4. servlet container 和 web container
Servlet Container
Contained JDK
and JDK
do not have a feature that allows a Servlet
run up, there is a corresponding Servlet
process Servlet
process is responsible for receiving front-end CGI
request is passed over, and the local JVM
processing on Servlet
is also responsible for monitoring the local .java
program modification is occurring, modify the event of the let the compiler to re- .class
file
Web Container
Is a containing Jasper
and Servlet
related technical framework, which Jasper
is responsible for monitoring the local .jsp
program is modified occurred upon modification according to the needs to replace .java
the source code, and .java
it is to Servlet
be processed
Web Container
Commercial implementations: websphere
, weblogic
Web Container
the open source implementation: tomcat
,jetty