Learn key technologies in Java development

 Servlet (Server Applet), the full name of Java Servlet. It is a server-side program written in Java. Its main function is to browse and modify data interactively and generate dynamic Web content. A narrow servlet refers to an interface implemented by the Java language, and a broad servlet refers to any class that implements the servlet interface. Servlets run on application servers that support Java. In terms of implementation, servlets can respond to any type of request, but in most cases, servlets are only used to extend web servers based on the HTTP protocol. The implementation process of servlet technology: JavaSoft's Java Web Server was the first to support servlet technology. After that, some other Java-based Web Servers began to support the standard Servlet API. The main function of servlet is to interactively browse and modify data and generate dynamic data. Web content. This process is: 1) The client sends the request to the server 2) The server sends the request to the servlet; 3) The servlet generates the response content and transmits it to the server, and the response content is dynamically generated, usually depending on the client's request; 4) The server will The response is returned to the client. Servlet life cycle: 1. The client requests the Servlet; 2. 2. Load the servlet class into memory; 3. Instantiate and call the init() method to initialize the servlet; Service() calls the implementation methods such as doGet() or doPost() according to the different request methods; 5. Destory(); For more client requests, the Server creates new request and response objects, still activating this servlet's service() method, passing it both objects as parameters. This repeats the above loop without calling the init() method again. Generally, a servlet is initialized only once (only one object). When the server no longer needs the servlet (usually when the server is closed), the server calls the destroy() method of the servlet. Compared with traditional CGI technology or technology similar to CGI technology, Servlet technology has higher efficiency, easier to use, more powerful functions, better portability and lower investment. * Convenience Servlet provides a large number of utility routines, such as automatically parsing and decoding HTML form data, reading and setting HTTP headers, handling cookies, tracking session state, and more. * Powerful In Servlet, many tasks that are difficult to accomplish with traditional CGI programs can be easily accomplished. For example, servlets can interact directly with Web servers, whereas ordinary CGI programs cannot. Servlets can also share data between programs, making things like database connection pooling easy to implement. * Good portability Servlet is written in Java, Servlet API has perfect standard. Therefore, servlets written for IPlanet Enterprise Server can be ported to Apache, MicrosoftIIS, or WebStar without any substantial changes. Almost all major servers support servlets directly or through plugins. * Save investment Not only are there many cheap or even free web servers available for personal or small-scale websites, but for existing servers, if it doesn't support servlets, it's often free to add this feature (or just need very little investment). Form data, reading and setting HTTP headers, handling cookies, tracking session state, etc. * Powerful In Servlet, many tasks that are difficult to accomplish with traditional CGI programs can be easily accomplished. For example, servlets can interact directly with Web servers, whereas ordinary CGI programs cannot. Servlets can also share data between programs, making things like database connection pooling easy to implement. * Good portability Servlet is written in Java, Servlet API has perfect standard. Therefore, servlets written for IPlanet Enterprise Server can be ported to Apache, MicrosoftIIS, or WebStar without any substantial changes. Almost all major servers support servlets directly or through plugins. * Save investment Not only are there many cheap or even free web servers available for personal or small-scale websites, but for existing servers, if it doesn't support servlets, it's often free to add this feature (or just need very little investment). Form data, reading and setting HTTP headers, handling cookies, tracking session state, etc. * Powerful In Servlet, many tasks that are difficult to accomplish with traditional CGI programs can be easily accomplished. For example, servlets can interact directly with Web servers, whereas ordinary CGI programs cannot. Servlets can also share data between programs, making things like database connection pooling easy to implement. * Good portability Servlet is written in Java, Servlet API has perfect standard. Therefore, servlets written for IPlanet Enterprise Server can be ported to Apache, MicrosoftIIS, or WebStar without any substantial changes. Almost all major servers support servlets directly or through plugins. * Save investment Not only are there many cheap or even free web servers available for personal or small-scale websites, but for existing servers, if it doesn't support servlets, it's often free to add this feature (or just need very little investment).

JSP technology

The full name of JSP is Java Server Pages, and the Chinese name is java server page. It is basically a simplified Servlet design. It is a dynamic web technology standard advocated by Sun Microsystems and established with the participation of many companies. JSP technology is somewhat similar to ASP technology. It inserts Java program segments (Scriptlets) and JSP tags (tags) into traditional web page HTML (a subset of standard general markup language) files (*.htm, *.html) to form JSP file, the suffix is ​​(*.jsp). Web applications developed with JSP are cross-platform and can run on both Linux and other operating systems. It implements java extensions in Html syntax (in the form of <%, %>). Like Servlets, JSPs are executed on the server side. Usually returned to the client is an HTML text, so the client can browse as long as there is a browser. JSP technology uses the Java programming language to write XML-like tags and scriptlets to encapsulate the processing logic for generating dynamic web pages. Web pages can also access application logic for resources that exist on the server side through tags and scriptlets. JSP separates web page logic from the presentation of web design, supports reusable component-based design, and makes the development of web-based applications quick and easy. JSP (JavaServer Pages) is a dynamic page technology whose main purpose is to separate presentation logic from Servlet. Java Servlet is the technical basis of JSP, and the development of large-scale Web applications requires the cooperation of Java Servlet and JSP to complete. JSP has the simple and easy-to-use Java technology, completely object-oriented, platform-independent, safe and reliable, and is mainly oriented to all the characteristics of the Internet. 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326173152&siteId=291194637