JSP program development study Note 1

Source: Internet
Author: User
Tags array definition

As the interaction between PC-end WEB and embedded devices in the project involves JSP program development, the time span for learning JSP development is tentatively set to one month (). On the National Day holiday, I went to the bookstore to buy a guide related to JSP development. I really cannot buy more books in the bookstore. I am so poor when I buy more books. After I bought it, I scanned the QR code on my mobile phone. For a book with the original price of 45 yuan, Amazon only sold 36 yuan, and Dangdang only needed 31.5 yuan, I feel that I will never buy books in the real bookstore any more. I really cannot afford it. PS: I must make good use of the barcode and QR code scanning to collect the prices of all parties in the future.

Start Time: 2013-10-04

Reference materials: "JSP program development basic tutorial and experiment Guide", Wang Xiaojun, Tsinghua University Press.

Study time ~ January

Chapter 1: Overview of JSP; Chapter 2: Java and JSP Technology

Chapter 1 JSP Overview

1.1 common dynamic web technologies

ASP technology, Active Server Page, dynamic Server Page;

PHP Technology, Hypertext Preprocessor, Hypertext pre-processing language;

With ASP. NET technology, WEB application developers can use this development environment to implement more modular and powerful applications.

JSP technology, based on the independence of platforms and servers, can run on any WEB server and support a variety of Toolkit provided by more developers.

1.2 Working Principles of JSP

For users, accessing JSP applications and WEB servers is no different from accessing common WEB servers. Because JSP applications, Java applications, and HTML applications are all placed on the same server.

However, for JSP applications and WEB servers, although JSP applications (Java applications) work with WEB servers, users will enter a pair to the browser. if jsp is a webpage request with the extension, the browser will send this request and pass it to the appropriate WEB server that contains the requested page.

The WEB server searches for the requested webpage on the system and passes the whole webpage to the Java application server for execution. If the JSP page does not contain a Java fragment program, the WEB server directly sends the entire page content back to the browser.

When the web server reads a jsp page, the jsp interpretation engine will browse the page and find the content that contains the <%> label or other built-in labels. If the TAG content is queried, the TAG content is passed to the application that can execute java code snippets (java Server), and the java code snippets on the page are compiled and interpreted, return the result set to HTML.

1.3 create a JSP server

Install the JDK Program

Install and start Tomcat

1.4 JSP development tools

Eclipse development tools

MyEclipse development tools

Chapter 2 Java and JSP Technology

2.1 Java Basics

Basic data types: integer, floating point, Boolean, and character.

Constants: constants in Java are of a type. They are different from constants in C/C ++. They cannot be defined using # define or the const keyword, instead, constants can only be defined using the final keyword in the object type.

Example: final double PI = 3.1415926;

Array: Unlike C/C ++, Java does not allocate memory for array elements in the array definition. Therefore, [] does not specify the number of elements in the array, that is, the length of the array. Unlike C/C ++, Java checks the array elements out of bounds to ensure security.

Example: String str [];

Str = new String [5];

2.2 operators and expressions

The difference between the shift operator >>> and >>:

>>: Indicates the right shift with a symbol. The removed part will be discarded, that is, the low shift, and the high zero. For example, int I = 15; I = I> 2; after the shift, the value of I becomes 3;

>>>: Indicates the unsigned right shift. When the low position is removed, the original high value is copied to the high position.

Note: There is no <operator in Java.

Unlike C/C ++, Java extends operators so that they can be connected to strings. For example, "abc" + "de" returns "abced "; for the modulo operation, the operand can be a floating point number, for example, 15.8% 7 = 1.8;

In Java, any data type (including basic and combination types) can be passed through = or! = To compare whether it is equal (this is different from C/C ++). The result of the relational operator returns true or false, rather than 1 or 0 in C/C ++;

2.3 Java Control statements

For Loop execution process:

For (expression 1; expression 2; expression 3)

{

// Loop body

}

Execute expression 1 first, then execute expression 2. If expression 2 is true, execute the loop body, return execution expression 3, and return expression 2 again;

Java provides three types of Jump statements: return Statement, break statement, and continue statement.

2.4 Java Object-Oriented Programming

Class and Object

Class: interfaces are added compared with struct;

Object: Class instantiation;

Inheritance

An important feature of object-oriented programming is that a class shares features and behaviors from another class. Subclass and parent class.

Package: Package, compile, and generate a package;

Interface: interface declaration and implementation;

Exception Handling: the Java exception handling mechanism introduces classes used to describe and handle exceptions. Each exception class reflects a type of running error. The class defines information about the exception class and the method for handling the exception. Exception Handling can be divided into three steps: throwing an exception, capturing an exception, and handling an exception.

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.