ServletAnd jsp (preferred for SUN Enterprise Applications) knowledge Review (1) Servlet & jsp (preferred for SUN Enterprise Applications) technology Overview
1. ServletFunctions
· Read the explicit data (form data) sent by the client program)
· Read the implicit data (request header) sent by the client program)
· Generate corresponding results
· Send explicit data to the Client Program (HTML)
· Send implicit data to the Client Program (status code and Response Header)
2.Why do we need to build Web pages dynamically?
· The content on the web page is based on the data submitted by the user.
· The content on the web page is exported from frequently changing data
· The Web page uses information from databases or other server resources
3. servletAdvantages over traditional CGI technology
· High Efficiency
-Replace operating system processes with threads, with a single servlet copy
· Convenience
-Numerous high-level utilities
· Powerful functions
-Data sharing, connection sharing, and continuous Storage
· High portability
-Running on almost all operating systems and servers
· Low Cost
-You can choose from a large number of free or low-cost servers.
· Security
-If no shell program is designed, the transfer operator attack is eliminated.
There is no buffer overflow problem.
· Mainstream
4. assumerver Pages(Jsp (preferred for SUN Enterprise Applications)-servlet Function Extension
5.Implement a simple deployment Method
· Copy to a shortcut or symbolic link
-Create a shortcut for install_dir/webapps/ROOT/WEB-INF/classes.
-For servlets that do not use a package, copy the. class file to this shortcut.
-Copy the entire directory to the package's servlets
· This is the simplest method for beginners.
· Use the-d option of javac
-This method can be used to place the source file in a single location and automatically
The. class file is placed in another location.
· The IDE is responsible for deploying tools.
· Use ant or similar tools
-Ant is especially popular when custom Web applications are used.
6. WebApplication: preview
· Learning
-Use the default Web application (ROOT in tomcat (a useful JSP running platform)
-Use the default URL (http: //.../servlet/ServletName)
-A bit
· Simpler
· Tests can be performed without restarting the server or editing web. xml (standardization is getting closer and closer)
· Deployment
-Use the customized Web application (in tomcat (a very useful JSP running platform) as install_dir/webapps
A directory in which the structure is similar to ROOT)
-Register custom URLs in WEB-INF/web. xml (standardization is getting closer and closer)