protected void doGet(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException
Called by the server to allow the Servlet to handle GET requests
req-An object containing requests made by the client to the Servlet res-An object containing the response that the Servlet sent to the client
In short, when the browser (client) asks the server for some request (such as trying to transition the screen), the http server (Apache)? Calls this method Also called when the server sends a response (such as the information on the next page) to the client It feels like the JVM has decided to call public static void main (String [] args)?
The doGet method mainly describes the process to output the contents requested by the client. The doPost method is mainly used when data is sent from the client.
Recommended Posts