Servlet & JSP review notes 01

1. Servlet Meaning: the server-side applet, only part of the server. Servlet Little
  Standard: Sun used to expand the company to develop a Web server component specification function.

  . a web server extension function: extend the existing functionality of a web server (early web server can only display static pages)
  b component specification: meet certain specifications, to achieve some of the features can not operate independently, and need to be deployed to the container in order to run software modules.

  Container: meet certain specifications, to provide a program component operating environment.

Evolution 2.WEB applications:
  stand-alone program - "Network program (host terminal mode -" two-tier architecture CS - "three-tier architecture CS -" BS architecture (Browser + Web Server + DB)

3. The two-tier architecture program CS:
  Features: 1. Database as a Server, a database written in a particular programming language business logic;
              2. Client provides a small amount of operating pages and business logic processing.
  Disadvantages: poor portability (need to replace the database reprogramming);
      2. is not suitable for large-scale application (client to establish a continuous connection between the database).

4. The three-tier architecture program CS:
  Features: 1. The database is only responsible for data management;
              2. the application server handles all business logic;
                   3. The client is only responsible for providing the operation page.
  Advantages: 1. portability, and suitable for large-scale applications.
  Cons: 1. The client needs to be installed separately, developing complex (require a custom protocol, write client and server communication module).

5.BS architecture program:
  Features: 1. The database is only responsible for data management;
                   2.WEB server is only responsible for business processes;
              3. The browser is responsible for providing operation page.
  Advantages: 1. no separate mounting client;
                   2 with respect to the development of communication simple CS, the client and server communications modules are using the standard HTTP protocol.

Step 6. Servlet development of
  1. Preparation of a Servlet interface or inherit java class HttpServlet implementation;
  2. javac over the source file byte code;
  3. The assembly is now complete package (according to a certain directory structure Bale);
  

  4. Deployment: The entire asking price clip on the configuration of Tomcat webapps folder;
  5. Start Tomcat and access the Servlet.

7.web server common return values:
  1.404: To access the resource was not found.
  2.405: web server can not find the service method processing the request.
  3.500: Internal program run error.

8. The container Processing requests:
  1. Find the request based on the content URL-pattern in the web.xml;
  2. find the corresponding servlet-name pattern-The URL;
  3. find the corresponding servlet-class according servlet-name.


9.HTTP protocol
  HyperText Transfer Protocol Hypertext Transfer Protocol
  specified by the W3C (World Wide Web Consortium) an application layer protocol that defines how to format the data communications and communications between the browser and the web server.

  

 

 

10.Servlet HTTP protocol processing
  when a web container request is received, the communication data is mapped into two by a web container objects. Data corresponding to the request is HttpServletRequest, corresponding to the object is returned HttpServletResponse.

Guess you like

Origin www.cnblogs.com/ibowen/p/12347043.html