1. Software structure classification and service introduction

1. Introduce

  • Java system classification:

JavaSE: After learning JavaSE technical points, you can develop desktop applications

JavaME: After learning JavaSE technology points, you can also develop related mobile mobile applications

JavaEE: After learning the technical points of JavaSE and related technical points in the JAVAEE system, you can develop enterprise-level applications

 

Enterprise-level applications (JavaEE): Generally speaking, most of the applications are applications combined with Web components, which are also the focus of the Java system. It is also the strength of Java programming work.

 

 

  • JavaEE technology (technical standard defined by sun company): There are 13 kinds in total, javabean, xml, servlet, jsp, jms, jdni, jpa, jdbc, jta, ejb, rmi, javaemail, jdi

 

 

 

 

 

2. Software system architecture

C: Client client S: Server server B: Browser browser

 

In the software system system: no matter whether you develop desktop applications or web applications, there are clients and servers. The difference is that the client of the Web application is a browser, while the desktop application is generally a client program completed by the GUI programming technology in Java.

 

2.1 C/S structure (desktop application)

  • C/S structure is client/server (Client/Server), such as QQ, Feiqiu;
  • Need to write server-side programs, as well as client-side programs, for example, what we installed is the QQ client-side program;
  • Disadvantages: It is annoying to update both the client and the server at the same time when the software is updated;
  • Advantages: better security.


 2.2 B/S structure (web application)

 

  • B/S structure is browser/server (Browser/Server);
  • Advantages: only need to write server-side programs;
  • Disadvantages: poor security.

 2.3 Server Concept

Physically, a server is a PC.

 

  • WEB server: In fact, it is a software that installs web services on a PC, and this PC is called a WEB server.
  • Database server: In fact, the database management service software is installed on the PC, which is called the database server.  

 

2.4 The request process of the web application

Requests for web applications: Following the request/response programming model, a request must have a response, and a request must come before a response.

Request processing process diagram:



 

 

 

 

Simple diagram of request response:

  • Handling static resources:



 

 

  • Handling dynamic resources:


 2.5 Web service software (middleware)

Role: Share local resources to external access

 

  • Static resources: html, css, js, imag, etc. only need a browser to run
  • Dynamic resources: browsers such as servlet, jsp, php, etc. cannot be directly interpreted and executed. You can use the web server to parse and translate before the browser can execute.

 

        If a web server that can only handle static resource files: called an HTTP server

 

        If a server that can handle dynamic resources is called an application server or a web server

 

 

2.6 Classification of Web Servers

The following servers all support the processing of dynamic resources and the technical specifications of JavaEE.

 

 

  • Tomcat (Apache): Currently the most widely used Java Web server, only supports Servlet, jsp technical specifications, Tomcat can also be called Servlet container
  • JBoss (Redhat): Supports JavaEE 13 technical specifications and has a wide range of applications (there are enterprise editions that are charged, and community editions that are free)
  • GlassFish (Orcale): Oracle develops a Java Web server, which is not widely used, and can support most of the technical specifications of JavaEE for free.
  • Resin (Caucho): It supports JavaEE 13 technical specifications and is more and more widely used;
  • Weblogic (BEA's product, but acquired by Oracle): supports JavaEE, suitable for large-scale projects, but requires money;
  • Websphere (IBM): Supports JavaEE, suitable for large projects, but costs money.

 

 

The following is an HTTP server that can only handle static resources:

 

  • Apache server
  • Nginx server

3. Tomcat container understanding

Download address: http://tomcat.apache.org/

 

3.1 Directory structure of tomcat

 



 

3.2 Common errors of tomcat

  • When starting the tomcat software, a java.net.BindException: Address already in use: JVM_Bind <null>:8080 is reported, indicating that the default port number 8080 of tomcat is occupied by other programs.

 

Solve the problem:



 

  • Tomcat flashes when it starts up, and generally speaking, the jdk is not configured properly. From this point of view, tomcat depends on the jdk environment

4. Introduction to Web Project Structure

4.1 Standard directory structure for web applications:

---App Name Directory

  ---WEB-INF directory

    ---classes directory to write source code compiled bytecode

    ---web.xml file

    ---lib directory supports third-party jar packages of developed applications

  ---Options are generally placed in application resource files (written by programmers) 

  ---Optional other resource files

 

Note: The resource file browser in the WEB-INF directory cannot be accessed directly

      Browsers can directly access resource files at the WEB-INF directory level

From this point of view, the resource files in the WEB-INF directory are protected

 

4.2 Integrating tomcat software into Eclipse tools

skip ......

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326572951&siteId=291194637