Tomcat
Introduction:
Development language such as: PHP, you can use the Smarty framework.
The other most popular framework is the MVC framework: Data
Bussiness Business
Presentation Show
And like this language that can use the framework, especially for developing web sites.
C language compared to PHP, first, the C language and server hardware and the OS is very close, difficult to use the framework, and the porting platform is difficult, and the cost of code maintenance is quite high. But it is because of the hardware, the system tightly integrated, so the development of the program runs quite fast. such as the development of drivers and so on.
Api:application Programming Interface (can call the Program API interface, call the system library file, there are systems called package out)
Abi:applications binary interface (binary interface applied)
A program is designed to develop quickly, so it uses APIs provided by the operating system. You know, a program to run on the system, need to compile to run, that is, the development of the language into the system can recognize the binary machine instructions. The APIs that are compiled on the Windows operating system are definitely different from the APIs that were developed on the Linux system. Therefore, different system development programs cannot run on another system.
Operating system running platform Windows,api ABI (. dll), Linux,api Abi (. So)
This appears: Posix:portable operating system, which can be compiled across platforms.
Therefore, a program generally after a system environment is compiled can not be run on another system, because the call to the dynamic library, and binary format (ABI) are different.
Therefore, in order to run across platforms, it is also necessary to erase the system's dynamic library and ABI. This is where Java comes in. 1995, Java1.0 by Sun company Jamesgosling led research and development.
The components of Java contain four separate but interrelated technologies:
Java programming language
Java API (Java for rapid development)
Java class file format (Java file, bytecode bytecode needs to run on JVM)
Jvm:java Virtual Machine (for interpreting bytecode: bytecode)
The Java program language (. Java) is compiled into a Java class file (. Class) using Javacompiler and then run on the JVM. and the library file that Javaapi calls to will also need to be loaded into the library file.
The JVM is implemented in the following three ways:
1. One-time interpreter that interprets bytecode and executes
2. The instant compiler (Just-in-time complier) caches the compiled results, so it relies on more memory caches to interpret the results
3. Adaptive compiler (cache around 20% code)
So these four technologies, the Java language is a sun company developed and open source, and Javaapi's specification because of open source, and later evolved to be defined by a third-party organization, JAVACLASS format specification is still defined by the Sun Company, the final JVM, Provided by Sun and third party organizations.
The JVM provided by Sun, the total is called HOTSPOTJVM, but the specific software is divided into the following two kinds:
JRE java:running Environment.
JDK Java: Development environment.
The JVM provided by the third party is called OPENJDK: Open source development plus run.
The JDK can be understood to contain Java code +JAVAAPI+JVM, which is the smallest environment for Java development. JRE only JVM and Java SE API
Java can be divided into three categories of applications:
Java SE Standard edtion J2SE
Java ee Enterprise Edition ee
Java ME Mobile Edition J2ME
After Java came into being, the need for dynamic Web sites was growing, and Java introduced the technology of applets. This thing as long as the HTML web Developer to join the applet, the user's browser with the JRE plug-in, you can run directly. Enables dynamic Web sites to be implemented. But this is how the client Dynamic Web site is implemented.
The CGI technology was then born, Cgi:common Gateway interface The Universal Gateways protocol.
Html,mime can convert all other formats into text format.
Then Java came up with a servlet to introduce CGI-like technology. Servlet: Simply speaking, using the Java language CGI technology
The advent of servlet technology adds Java's ability to handle HTTP. But then another problem arises, and all HTTP requests must be turned into a back-end Java program to compile and run, which seriously affects Java's processing performance. And Java programmers must also understand HTML, so that Java returns to the user when the HTML format to be correct. So you have to use the framework, and the JSP is born.
Jsp:java Server page, a technique that embeds HTML pages, lays the groundwork for using the MVC framework.
SSH framework: Structs,spring,hebernate.
Jsp--> Servlet (via Jasper)
servlet Container servlet Container
Web Container Web Container
In general, the functionality of the JVM is extended. So is a JVM instance, so how do 100 requests parallel processing? Is it possible to start a 100 JVM instance? A JVM is a process, but the creation and revocation of this process is costly and resource intensive, so the JVM implements parallel processing by initiating multiple threads. This makes the JVM run-time memory allocation very complex. Can be understood through the following introduction.
Run-time data region:
Thread Private Memory Area: program counter
Java Virtual machine Buyers
Thread Shared Memory Area: Method area
Java Heap (Storage object) (class-Perform operation, Object-Execute method, object is the same class)
All of the above is stored in memory, when the memory is full memory overflow, in order to avoid this situation, Java will be memory recovery, Java timed automatic memory recycling, using the garbage collector GC.
Garbage collection algorithm:
1, Mark Clear (will produce fragmentation)
2. Copy
3. Mark Finishing
Garbage collector: Serial, Parnew, Parallel scavenge, Serial old, Parallel old
Cms:concurrent Mark Sweep Parallel Tag Cleaner
Features: Concurrent collection, low pauses, but unable to collect floating garbage
JDK Installation
The Oracle website is downloaded and the JDK is installed.
Configure environment variables after installation: vim/etc/profile.d/java.sh;
"Export java_home=/usr/java/jdk1.6.0_21"
"Export path= $PATH: $JAVA _home/bin"
. /etc/profile.d/java.sh
JVM: Start the JVM virtual machine, that is, use Java this program.
Configuration parameters for Java commands:
-xx:+<option>: Turn on the function specified by this parameter
-xx:-<option>: Off function
-xx:<option>=<value>: Assign a value to option specified
Java-xx:+printflagsfinal to get configuration parameters help!
Class Loader: A class loader is required to run a class that needs to run to the runtime, and it is possible to rely on other public classes or private classes.
Life cycle of a class: [Loading-verification-preparation-resolution-initilization]-using-unloading
Sun's JDK monitoring and troubleshooting tools
JPS,JVM process Status Tool: Displays a list of all the hotspot virtual machine processes in the specified system
JSTAT,JVM Statistic Monitoring Tool: Collects and displays operational data for all aspects of the hotspot virtual machine
Jinfo: Displays a hotspot virtual machine configuration information that is running
Jmap: Generating a memory dump snapshot of a hotspot virtual machine
Visualization tools:
Jconsole:java Monitoring and Management console
JVISUALVM:
Java EE apis:ejb JMS JMX JTA JavaMail
Java SE Apis:jndi JAXP
JAVA EE Application Servers:
Websphere Weblogic oc4j JBoss JOnAS Geronimo glassflish
The relationship of Tomcat components
<Server>
<Service>
<connector/>
<Engine>
<Host>
<Context> </Context>
</Host>
</Engine>
</Service>
</Server>
<%@ page language= "java"%>
<%@ page import= "java.util."%>
<title>jsp test.page.</title>
<body>
<% out.println ("Welcome to mageedu. Site,http://www.magedu.com "); %>
</body>
Tomcat under the conf/
Server.xml core configuration file, Tomcat-users.xml User Rights Management file, Web. XML default application Deployment descriptor, Context.xml context profile
This article is from the "Jeremy Ops Architecture" blog, make sure to keep this source http://jeremybale.blog.51cto.com/3341343/1654788
Java technology Brief and Tomcat deployment