JSP program development study notes 1

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

Because the interaction project in PC end WEB and embedded device relates to the development of JSP program, so I want to take time to learn the development of JSP, the time span of the temporary location for a month (from 2013-10-04 to 2013-11-03). This National Day holiday home specially went to the bookstore and bought the JSP related to the development of guide books, books in the bookstore really can not buy, buy more on the poor. Buy back after using mobile phone swept down the back of the bar code, price 45 yuan book, Amazon sold only 36 yuan, Dangdang more as long as 31.5 yuan, I won't buy books in the bookstores, really vulnerable, PS: must go out to make good use of bar code, two-dimensional code scanning, it is a collection of weapon all prices.

Start time: 2013-10-04

Reference book: "JSP programming foundation course and experiment guidance", Wang Xiaojun, Tsinghua University press.

Learning time: 2013-10-04~2013-10-07

Learning chapters: the first chapter is the overview of JSP; the second chapter Java and JSP Technology

The first chapter is the summary of JSP

The 1.1 most common dynamic webpage technology

  ASP, Active Server Page, active server pages,

  PHP, Hypertext Preprocessor, hypertext preprocessor,

  ASP.NET technology, WEB application developers to use the development environment can achieve a more modular, more functional applications.

  JSP technology, JSP technology based on platform and server are independent of each other, can run on any WEB server, and supports a wide range from the more Developers Kit.

1.2 the working principle of JSP

  To the user, access to JSP applications and WEB server, and access to common WEB server, there is no difference. Because JSP applications, Java applications and HTML applications, are placed on the same server.

  However, for the JSP application and WEB server, while JSP applications (Java applications) to work with the WEB server to the browser, users will be input to.Jsp as the extension of the webpage request, the browser will send this request, and pass it to the appropriate page containing the requested WEB server.

  While the WEB server looks in the system the requested webpage, and the entire page is transferred to the Java application server. If the JSP page does not include the Java fragments of the program, the WEB server will be the contents of the whole page directly sent back to the browser.

  The web server reads JSP webpage, JSP engine will visit this page, and search contains <%%> tag or other built-in tag. If the query to the label contents, the application will label content to execute java code fragment (Java Server), and the Java code fragments within the page is compiled, interpretation, and return the result set to HTML.

1.3 set JSP server

  Install the JDK program

  Install and start Tomcat

1.4 JSP development tools

  Eclipse development tools

  MyEclipse development tools

The second chapter Java and JSP Technology

2.1 Java based

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

  Constant: Java, constant is a type, with different constants in C/C++, #define can not be used to define, also cannot use the const keyword, and can only use the final keyword in object type to define constants.              

    For example: final double PI=3.1415926;

  Array: unlike C/C++, Java in the array is defined as an array element does not allocate memory, so [] don't pointed out that the number of elements in the array, the array length. Unlike C/C++, Java of the array element to bounds check to ensure safety.

    For example: String str[];

       str = new String[5];

2.2 operators and expressions

  Shift operator > > > > > difference:

    >>: Express Signed right shift, remove the part will be abandoned, namely low removal, high fill zero. For example, int i = 15; I = I > > 2; shift after the I value to 3,

    >>>:  Representation of the unsigned right shift, low are removed, the original high copy high value.

  Note: no < Java; <<operator.

  Unlike C/C++, Java is extended to the operator, so that it can be connected to a string, such as "ABC" and "de" for "abced"; the results of the modulo operation, its operand can be a floating point number, for example 15.8%7=1.8;

  In Java, any type of data (including the basic type and combination type) can use = = or! = to equality (unlike C/C++), relational operator returns true or false, but not C/C++ 1 or 0,

2.3 Java control statements

  The for loop execution process:

  For (1. 2; expression; expression 3)

  {

    // The body of the loop

  }

  The first implementation of the expression 1, then execute the expression 2, if the expression value of 2 is true, then the body of the loop is executed, and then execution expression returns 3, finally returned to the expression 2,

  Java provides a jump statement in three ways: a return statement, break statement and the continue statement.

2.4 object oriented programming in Java

  Classes and objects

    Class: compared with the structure, increase the interface,

    Object: class instantiation,

  Inheritance

    An important feature of object oriented programming, it is a kind of shared characteristics and behavior from another class of terms. Sub class, the parent class.

  Package: packed, compile and package,

  Interface: interface declarations, interface implementation,

  Exception: exception handling mechanism of Java, introduced to describe and handle the exception class. Each of the abnormal reaction is a runtime error, the class definition contains information of the exception class and method for abnormal processing. Exception handling can be divided into throw, catch the exception and exception handling three steps.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Doris at November 16, 2013 - 4:57 PM