1.servlet can theoretically handle many forms of request response, HTTP is just one of them, so httpservletrequest, HttpServletResponse are subclasses of ServletRequest and Servletresponse respectively, HttpServletRequest and ServletRequest are interfaces, HttpServletRequest inherited from ServletRequest, httpservletrequest more than servletrequest some methods for the HTTP protocol. such as GetHeader (String name), GetMethod (), getsession (), etc.
2.HttpServletRequest implementation is based on different servers, Tomcat has the implementation of Tomcat, WebLogic has WebLogic implementation
3. Generate a unique file name: Uuid.randomuuid ();
When the 4.WEB container starts, it creates a corresponding ServletContext object for each Web application that represents the current Web application. Because all servlets in a web app share the same ServletContext object, communication can be achieved between servlet objects through ServletContext objects. Multiple servlets implement data sharing through ServletContext objects.
such as implementing a servlet's forwarding.
RequestDispatcher rd = Getservletcontext (). Getrequestdispatcher ("/1.jsp"); Root path relative to the root of the current context, not the file on the physical server
Rd.forward (Request,response);
Implementing Data interactions
This.getservletcontext (). SetAttribute ("Today", "Yestoday");
Java Web Learning Note-1