Javaweb Learning Summary -01 Introduction to Javaweb development

Source: Internet
Author: User

A basic concept

1 Knowledge about web development

The Web, which represents the meaning of a Web page, is used to represent resources that an Internet host is accessing outside.

Web resources on the Internet for external access are divided into:

    1. Static Web resources (such as HTML pages): Data that is accessible to people in a Web page is always the same.
    2. Dynamic Web resources: refers to the Web page for people to browse the data is generated by the program, at different points of time to access the Web page to see the content varies.

Static Web Resource development technology: HTML
Common Dynamic Web Resources development technology: Jsp/servlet, ASP, PHP, etc.
In Java, Dynamic Web resource development technologies are collectively referred to as Javaweb.

2 Web applications

Web applications means browser-accessible programs, often referred to as Web applications. For example, there are a.html, b.html ... multiple Web resources, which are used to provide services externally, you should place these multiple Web resources in one directory to form a Web application (or Web application).
A Web application consists of several static Web resources and dynamic Web resources, such as HTML, CSS, JS files, JSP files, Java programs, support jar packages, configuration files, and so on.
After the development of Web applications, if you want to be accessible to the outside world, you need to give the Web application directory to the Web server management, this process is called virtual directory mapping.

3 web History

two phases of WEB development: static, Dynamic

4 Static web

HTM, HTML is the suffix of the Web page, if the content is now read directly on a server, it means that the contents of these pages are displayed to the user through the Web server.

The HTML language is an abbreviation for the Hypertext Markup language, and the server responds to the user using the HTML language.

Specific HTML data, you can refer to the video HTML combat, the entire static web operation process diagram is as follows:

In a static Web program, the client uses a Web browser (IE, Firefox, etc.) to connect to the server, use the HTTP protocol to initiate a request, tell the server which page I need to get now, and all the requests to the Web server. The Web server then extracts the content from the file system (the disk that holds all the static pages), depending on the user's needs. After the Web server is returned to the client, the client receives the content after the browser rendering parsing, to get the effect displayed.

  Disadvantages in the static Web:

  1, the content of the Web page can not be updated dynamically, all users see the content and the final effect is the same.

In order to make the static web display more attractive, you can add JavaScript to complete some of the page display effects, but these effects are on the client with the help of the browser display to the user, so on the server itself does not have any changes.
means to implement static Web client dynamic effects:

    • Javascript
    • VBScript (JavaScript is used most in real-world development .) )

  2, static WEB can not connect to the database, can not implement and user interaction.

Using a database to save data is now a choice for most systems, because data can be easily managed in the database, and additions and deletions can be done using standard SQL statements.

  

static pages need to master the knowledge points about the HTML tags of the form  

    • Form
    • Text
    • TextArea
    • Radio
    • CheckBox
    • Select
    • Hidden
    • Submit
    • Reset
    • button

static page development tools

Hbuilder: Developed the HTML5 IDE, a fast-coded geek tool.   

5 Dynamic Web

The so-called dynamic does not mean that the page will move, the main feature is: "The Web page display effect due to people change", and Dynamic web has interactivity, the content of the Web page can be updated dynamically. The process diagram for the entire dynamic web operation is as follows:

In the Dynamic web, the program still uses the client and the server, the client still uses the browser (IE, Firefox, etc.), connects to the servers over the network, uses the HTTP protocol to initiate requests (request), and all requests now go through a web Server to process.
If the client is requesting a static resource (*.htm or *.htm), the request is forwarded directly to the Web server, after which the Web server takes the content out of the file system and sends it back to the client browser for resolution execution.
If the client requests a dynamic resource (*.jsp, *.asp/*.aspx, *.php), the request is forwarded to the Web Container (Web container), the database is connected in the Web Container, After a series of operations, such as extracting data from a database, and then dynamically piecing together the contents of the page, putting together the content of the page, all the content is presented to the Web server, and then the content is sent back to the client browser through the Web server for parsing and execution.

6 ways to implement Dynamic Web applications

Dynamic WEB is now implemented in a number of ways , the more common are the following:

    • Microsoft asp,asp .
    • Php
    • JAVA servlet/jsp

1) Microsoft ASP, ASP.
Microsoft Dynamic Web Development is relatively early, and the earliest in the domestic most popular is the ASP. ASP is in the HTML language to add the VB Script, but the standard development application should be used asp+com, but the actual situation, in the development of ASP is basically in a page to write hundreds of thousands of code, page code is extremely chaotic.
The ASP itself has the limitation of development platform: Windows+iis+sql server/access,asp can only run on Windows operating system, ASP is now basically obsolete, This is mostly done with ASP. ASP. NET has improved performance and developed rapidly, but it is still limited by the platform. Asp. NET is primarily used in the C # language.

2) PHP
PHP Development is fast, powerful, cross-platform (platform refers to the operating system), and the code is simple.

3) servlet/jsp
This is the implementation language of the B/s architecture that Sun (which Sun has now been acquired by Oracle) and is based on the Java language, because the Java language is simple enough and clean.
The performance of servlet/jsp technology is also very high, not limited by the platform, each platform can be used basically. And in the run is the use of multi-threaded processing, so the performance is very high.
Sun's first launch of the Web technology introduced a servlet program, the servlet program itself, there are some problems, all the program is written in Java code +html, that is, to use the Java output statement, a line of output all the HTML code, and then , Sun has been inspired by the ASP, the development of JSP (Java Server Page), JSP some code writing effect and ASP is very similar. This makes it easy for some ASP programmers to turn to JSP learning and increase the market competition.

Two Web servers

1 Introduction to WEB servers

1) A Web server is a program that resides on some type of computer on the Internet and is a program that can provide documentation to the requesting browser. When a Web browser (client) connects to a server and requests a file, the server processes the request and feeds the file back to the browser, which tells the browser how to view the file (that is, the file type).

2) The server is a passive program: The server responds only when a request is made by a browser running on the Internet on another computer.

2 Introduction to common Web servers

To learn web development, you need to install a Web server and then develop the appropriate Web resources in the Web server for users to access using a browser.

1)Tomcat

Tomcattomcat is a minimal Web server that implements the Java EE Standard and is a core project of the Apache Software Foundation's Jakarta Project, developed by Apache, Sun, and other companies and individuals. Because of advanced Tomcat technology, stable performance, and open source free, so deeply loved by Java enthusiasts and have been recognized by some software developers, become the most popular Web application server. Learning Javaweb development generally uses the Tomcat server, which supports all JSP and servlet specifications, starting the interface

2) IIS

Microsoft's Web server product is Internet Information Services (IIS), which is a Web server that allows information to be published on the public intranet or the Internet. Ⅱs is one of the most popular Web server products, and many famous websites are built on the Ⅱs platform. IIS provides a graphical interface for administrative tools, called Internet Information Services Manager, that you can use to monitor configuration and control Internet services.

Three Building Javaweb application development Environment-TOMCAT Server

1 Why do I need to install a Web server?

Creating a Web page on the local computer is not accessible to the user, but if you start the Tomcat server and place the Web page on the Tomcat server, the user will be able to access it. What does that mean?

1) No matter what web resources, want to be accessed by a remote computer, must have a corresponding network communication program, when the user to access, the network communication program read the Web resource data, and send the data to the visitors.
2) A Web server is a program that is used to complete the underlying network communication. Using these servers, we developers need to focus on how the Web resources are written, without caring how the resources are sent to the client, greatly reducing developer effort.

2 Installing the JDK

1) Configuration Java_home

2) Configure path

3) configuration Class_path

3 Downloading and installing the Tomcat server

Tomcat Official site: http://jakarta.apache.org
Download the Tomcat installer package: http://tomcat.apache.org/

Note: The tomcat installation path cannot have kanji, special characters, or it may be problematic to run the server.

Four Web applications

1 URL

A Uniform Resource Locator is a concise representation of the location and access methods of resources that can be obtained from the Internet, and is the address of standard resources on the Internet. Each file on the Internet has a unique URL that contains information that indicates the location of the file and how the browser should handle it.

2 server responds to user actions

3 types of files involved in WEB applications

Web page file: Used to display information (HTML, jsp,asp).

Format files for Web pages: CSS Cascading Style Sheets

Resource files: Example images, audio, video files

Configuration files: Web. XML, Applicationcontext.xml, app.properties

4 Operating Environment support

Client program: Common client browser

    • Send Request
    • Display server Response information

Server-side programs:

    • Accept the request, respond to the user
    • Processing requests

Networking: Linking clients and servers

5 HTTP protocol

The primary protocol in a Web reference.

In the request/Response mode, the client sends the request and responds to the server side.

Stateless: The server side does not save information for the client.

Requests include: Request headers and request data.

The response includes: status code, Response header, and response data.

Next Javaweb Learning Summary -02 Tomcat learn and use

Learning materials:

1. Publish the service, the extranet has access to the project

2. Maven Learning note 03-eclipse The MAVEN project deploys debugs in TOMCAT7 and Jetty9

3. HTML Reference Manual

Javaweb Learning Summary -01 Introduction to Javaweb development

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.