When do ProcessRequest method called?
I am having a hard time why ,what and how the process request is called? why it is called and how it was called by the servlet container.
Servlets, as written in Java, are platform-independent. Removes the overhead of creating a new process for each request as Servlet doesn't run in a separate process. There is only a single instance that handles all requests concurrently.
Servlets provide a component-based, platform-independent method for building Web-based applications, without the performance limitations of CGI programs. And unlike proprietary server extension mechanisms (such as the Netscape Server API or Apache modules), servlets are server- and platform-independent.
A servlet is a Java programming language class that is used to extend the capabilities of servers that host applications accessed by means of a request-response programming model. Although servlets can respond to any type of request, they are commonly used to extend the applications hosted by web servers.
The servlet
has two important methods for handling the client's request:
1. doPost: in general handles requests coming from forms with post method.
2. doGet: handled requests coming from get method.
Now, ProcessRequest
method, is any other method that you can use into your code which is not bound (overridden) to anything.
It is called from the above methods to not complicate the code in them thus the requests are handled in it.
so you can use ProcessRequest
to handle your request if and only if it's called from one of the methods above.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With