A servlet is a Java class that is hosted and executed on a Web server that accepts client requests (via a Web server), performs tasks, and returns results, in a way that is compliant with the Servlet API specification, as a client-side applet. Because it is a Java class itself, it has all the benefits of Java, as well as its own advantages: interacting with other resources, security, and protocol-independent.
The official name of the Servlet API is the JSR (Java request specification), which is part of the JCP (Java Community Process). Before the JSR is published, he provides sample code that not only examines the design, but also provides examples for container providers (Servlet engines) and developers. This is called the Reference Implementation (RI). Apache Tomcat is the JSR ri, he is part of the Apache organization, the Apache Charter is "to provide a Java platform for the service provider solution, the Java platform is developed in an open and cooperative way." ”
"It feels very much like the patterns in EJB, Sun, the specification, ibm,bea the containers based on these specifications, and we, the application agents, write components based on these specifications, because the container and the component implement the same interface, or follow the same specification, You can make a component that is written on one container work well on another container that implements the specification. And here? Sun offers (or some of the sun's staff) the servlet APIs, which are interfaces, base classes, and specific requirements specifications, and then each container vendor writes a container based on the counter implementation interface , and our applications write components based on these specifications and the base classes provided by the container manufacturer, which is the servlet or class. ”
Three, the Tomcat directory problem
Bin to start and stop Tomcat scripts.
Common classes and jar files that are common to all Tomcat servers.
CONFG General configuration information, such as server definitions and user information.
WebApps A Web application that is automatically loaded when Tomcat starts.
Logs the Run-time log file generated by Tomcat.
Works is a temporary working directory used by the Web application.
Note: Logs and works were created the first time that Tomcat was started.
Defines a normal, protocol-independent servlet. It has all the methods of servlet and ServletConfig. The use and return value of the method is similar to the above, which is no longer explained here.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service