Javaweb Introduction and Tomcat download launch

Source: Internet
Author: User
Tags tomcat server


Javaweb Introduction

Javaweb, or J2ee,javaweb, is primarily using a variety of Java enterprise-class technologies to address the combined technology of the web-related Internet domain.

And these technologies have a standard that is the Java EE specification, the Java EE specification defines the Java EE component: Client applications and applets are components running on the client; Java servlet and Java Server Pages (JSP) is a Web component running on the server side; Enterprise Java Bean (EJB) components are business components running on the server side. The difference between the Java EE component and the "standard" class is that it is assembled in a Java EE application, has a fixed format and adheres to the Java EE specification, which is managed by the Java EE server.

So the web includes two parts: the Web server and the Web client. Java is very rich in server-side applications such as servlet,jsp and third-party frameworks, and so on.

Common techniques include the following:

650) this.width=650; "style=" width:320px; "src=" http://note.youdao.com/yws/public/resource/ a7b81952fa7e4d7a6486b4978207282b/xmlnote/office1d1733a7dc35420696c81ca96f10bf1b/4050 "alt=" 4050 "/>




Program architecture is usually divided into C/s and b/s architecture:

C/S Architecture:

Now the two most common program architectures are the C/s and/b architectures, and C/s, which is Client/server architecture, that is, the client/server architecture. Is familiar with the software system architecture, by assigning the task to client side and server side, reduce the communication overhead of the system, need to install client concurrency control

so c/S architecture of the program to reduce the pressure on the server, and the client is installed on the user's local computer, calling some local hardware devices is more convenient, suitable for large-scale games, audio software, various tools software program architecture method.

But the C/S architecture also has shortcomings, upgrade updates and maintenance is more troublesome, the system upgrade, all the clients need to upgrade, and no client can not use any function, the device needs to install, update the client.

Because of these features, data management software, online shopping, information interaction parts are not suitable for the use of C/s architecture.

c/S program architecture:

650) this.width=650; "style=" width:553px; "src=" http://note.youdao.com/yws/public/resource/ a7b81952fa7e4d7a6486b4978207282b/xmlnote/officed724b78abc1c4cad9a9d00e1a14ddb89/4051 "alt=" 4051 "/>


b/S structure:

another b/s architecture,The browser/server (browser/server) structure isInternetThe rise of technology, a change of C/s structure or an improved structure. In this structure, the user interface is fully implemented by the browser. In this structure, the user interface is implemented through the browser, a very small partTransactionslogic is implemented in the front end (Browser), but the primary transaction logic is on the server side (Server) to form a so-called three-layer 3-tier structure. b/S structure is a network structure model after the rise of web, Web browser is the main application software of the client. This mode unifies the client, and the core part of the system function is centralized to the server, which simplifies the development, maintenance and use of the system.

only one browser (Browser) is installed on the client, such asChrome,firefoxorInternet Explorer, Server InstallationOracle,Sybase,InformixorSQL Serverand other databases. Browser throughWeb Serverdata interaction with the database. ThoughtThe contents of the page are all downloaded from the server, the client does not have any updates after this said,This greatly simplifies the client computer load, reduce the system maintenance and upgrade costs and workload, reduce the overall cost of users, only need to refresh on the browser to see the latest content, do not update the client.

but b/S architecture also has the corresponding shortcomings, the game can only do web games, if it is a large-scale game browser can't stand, and the network and server can not support, because all the special effects rendering, data calculation have to be done on the server after the network sent to the browser, it is impossible to complete, so B/ s architecture is not suitable for large-scale games. b/S architecture can not be as convenient as the C/s architecture to access and invoke the user's local hardware devices, access is cumbersome. The b/S architecture concentrates the core part of the system function on the server, so the server pressure is also relatively large.

b/S program architecture:

650) this.width=650; "style=" width:553px; "src=" http://note.youdao.com/yws/public/resource/ a7b81952fa7e4d7a6486b4978207282b/xmlnote/office5f35b2c5a9794938968f16982c18166f/4052 "alt=" 4052 "/>


Mind mapping for Two program architectures:

650) this.width=650; "style=" width:551px; "src=" http://note.youdao.com/yws/public/resource/ a7b81952fa7e4d7a6486b4978207282b/xmlnote/office7daf7c8727ef47e1ad1d5c200fdf0268/4053 "alt=" 4053 "/>



In the B/S architecture program, requests made by the browser to the server are divided into dynamic requests and static requests:

Static Request:

The so-called static request, is to visit the Web page only download static files from the server, such as HTML, JS, CSS, picture files, etc., are static files. :

650) this.width=650; "style=" width:552px; "src=" http://note.youdao.com/yws/public/resource/ a7b81952fa7e4d7a6486b4978207282b/xmlnote/office8c1c5ef5dc934306b4b2db1d546d0a96/4054 "alt=" 4054 "/>


Dynamic Request:

The dynamic request is that your request is processed by the program on the server, interacts with the database, and then feeds back to the Web page, for example, the most classic dynamic request is the login account:

650) this.width=650; "style=" width:552px; "src=" http://note.youdao.com/yws/public/resource/ a7b81952fa7e4d7a6486b4978207282b/xmlnote/office69e7dfbcd55c47a6be15426c488d1e9e/4055 "alt=" 4055 "/>


Common techniques to implement dynamic pages:

650) this.width=650; "style=" width:258px; "src=" http://note.youdao.com/yws/public/resource/ a7b81952fa7e4d7a6486b4978207282b/xmlnote/officeec1aab197ebd4e34ad9f01986bbc91ed/4056 "alt=" 4056 "/>


about why the B/S architecture server pressure ratio is large:

This is because all the Web pages are stored on the server, so the client will need to download it from the server when it accesses the Web page. and all the request processing is done on the server, the dynamic request also need to be processed by the application on the server, and also to interact with the database data, so compared to the C/s architecture, b/S Architecture server pressure is large, by building a server distributed processing and cluster architecture can improve the performance of the server , which can solve the problem that the server is overloaded due to insufficient performance.




Tomcat Download and launch

Tomcat is a core project of the Apache Software Foundation (Apache Software Foundation) Jakarta Project, developed by Apache, Sun, and other companies and individuals. With Sun's involvement and support, the latest servlet and JSP specifications are always reflected in Tomcat, and Tomcat 5 supports the latest servlet 2.4 and JSP 2.0 specifications. Because the Tomcat technology advanced, stable performance, and free, so deeply loved by Java enthusiasts and has been recognized by some software developers, become the most popular Web application server, mainly used in Java.

Tomcat server is a free open source Web application server, the latest version of Tomcat is 9.0, is a lightweight application server, in small and medium-sized systems and concurrent access users are not widely used, is the first choice to develop and debug JSP programs. For a beginner, it can be thought that when the Apache server is configured on a single machine, it can respond to requests for access to the HTML (one application under the standard Universal Markup Language) page. In fact, Tomcat is an extension of the Apache server, but it runs independently at runtime, so when you run Tomcat, it actually runs separately as a separate process from Apache.

Tomcat is developed using Java, so as long as the JDK can be run on any system platform, we can download it to the Tomcat server on the official website:

http://tomcat.apache.org/

650) this.width=650; "style=" width:553px; "src=" http://note.youdao.com/yws/public/resource/ a7b81952fa7e4d7a6486b4978207282b/xmlnote/office09d4d61af651404082c39b09125dae25/4057 "alt=" 4057 "/>


I downloaded the 9.0 version:

650) this.width=650; "style=" width:553px; "src=" http://note.youdao.com/yws/public/resource/ a7b81952fa7e4d7a6486b4978207282b/xmlnote/office2aaee68f8af24187bae925b09d8b4564/4058 "alt=" 4058 "/>


After downloading the extracted to your own designated path, and then you can see the extracted directory, there are several folders:

650) this.width=650; "style=" width:553px; "src=" http://note.youdao.com/yws/public/resource/ a7b81952fa7e4d7a6486b4978207282b/xmlnote/officeb2956c3fdc234348b903dc7b24893cd7/4059 "alt=" 4059 "/>


The function of these directories can be referred to the following mind map:

650) this.width=650; "style=" width:553px; "src=" http://note.youdao.com/yws/public/resource/ a7b81952fa7e4d7a6486b4978207282b/xmlnote/officee7b23129c91b487d921639796e7b299d/4061 "alt=" 4061 "/>


Then it is the configuration environment variable:

We need to configure three environment variables, 1.java_home 2.PATH 3.catalina_home, which can be ignored if the Java_home is already configured:

    1. To configure Java_home, the variable value is the installation directory for the JDK:

650) this.width=650; "style=" width:553px; "src=" http://note.youdao.com/yws/public/resource/ a7b81952fa7e4d7a6486b4978207282b/xmlnote/office969a84c1d78b4c1e9471c4329df2e2f1/4062 "alt=" 4062 "/>


    1. Configure Path,path to configure the bin directory of the JDK:

650) this.width=650; "style=" width:540px; "src=" http://note.youdao.com/yws/public/resource/ a7b81952fa7e4d7a6486b4978207282b/xmlnote/officeb24ac00e90ae4f4c821cf16d21325bbf/4063 "alt=" 4063 "/>


3. Configure Catalina_home, which is the home directory where Tomcat is configured:

650) this.width=650; "style=" width:553px; "src=" http://note.youdao.com/yws/public/resource/ a7b81952fa7e4d7a6486b4978207282b/xmlnote/office53cc9993bf034fbebcd223d2f5e79a17/4064 "alt=" 4064 "/>


Mind Mapping:

650) this.width=650; "style=" width:524px; "src=" http://note.youdao.com/yws/public/resource/ a7b81952fa7e4d7a6486b4978207282b/xmlnote/office69da3d5e645246778cec9f44de26d130/4065 "alt=" 4065 "/>


After the environment variable is configured, you can start Tomcat, and you can start by locating the startup double-click in the Bin directory:

650) this.width=650; "style=" width:553px; "src=" http://note.youdao.com/yws/public/resource/ a7b81952fa7e4d7a6486b4978207282b/xmlnote/office531f2e3aa2af42debfcc031e6ccc593a/4066 "alt=" 4066 "/>


Startup success:

650) this.width=650; "style=" width:552px; "src=" http://note.youdao.com/yws/public/resource/ a7b81952fa7e4d7a6486b4978207282b/xmlnote/officed1e2fef5643c4166ba806323d4a6a3a9/4067 "alt=" 4067 "/>


About the issue with Tomcat startup:

    1. If you have a flashback when you start Tomcat, generally the environment variable is not configured, so check the environment variables, especially the CATALINA_HOME environment variables.

    2. Then there is already a Tomcat boot, so the port is in the case of a flash back.

    3. We can drag the startup to Cmd to execute, which will feed back the error log, example:

650) this.width=650; "style=" width:553px; "src=" http://note.youdao.com/yws/public/resource/ a7b81952fa7e4d7a6486b4978207282b/xmlnote/officeeaac8f1c32e542f9980f796d37e7b852/4068 "alt=" 4068 "/>

The above message is that the CATALINA_HOME environment variable is not configured.


If you check the environment variables are not a problem, or still flash back, you can create a Run.bat file (name can be customized), and then define the following:

Set Java_home=c:\program files\java\jdk1.8.0_112

Set path=%java_home%\bin;%path%

Set Catalina_home=.

Startup.bat


Then click on the new BAT file to launch, this method will be able to solve the problem of environment variables.

After successful startup, access to http://localhost:8080/through the browser, because Tomcat's default port is 8080, the following page appears to be successful and access to Tomcat's default page:

650) this.width=650; "style=" width:553px; "src=" http://note.youdao.com/yws/public/resource/ a7b81952fa7e4d7a6486b4978207282b/xmlnote/office58ff8be7fb9d426c98d6e2102c7d65d3/4069 "alt=" 4069 "/>


Mind Mapping:

650) this.width=650; "style=" width:553px; "src=" http://note.youdao.com/yws/public/resource/ a7b81952fa7e4d7a6486b4978207282b/xmlnote/office0d5504662ed44af9a2a1d3fbe5633afb/4070 "alt=" 4070 "/>



















This article is from the "zero" blog, make sure to keep this source http://zero01.blog.51cto.com/12831981/1977550

Javaweb Introduction and Tomcat download launch

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.