Hi guys.. Well can u tell me that why there is need of
"init()" , i mean why can not we initialize the servlet object
with the help of constructors?
Thank you.
Answer Posted / abhijit mishra
As per Servlet specification, the servlet container is
responsible for creating the servlet and initializing it( or
making it ready for client to request it).
So according to the Client:servlet container contract, the
servlet creation and inialization is done by the container
which will differ for different container provider.
So u can't use constructors to create servlets.
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
A client sends requests to two different web components. Both of the components access the session. Will they end up using the same session object or different session ?
What do you mean by scope object and what are its types?
Explains the differences between context.getrequestdispatcher() and request.getrequestdispatcher()?
What is session?
In the servlets, we are having a web page that is invoking servlets ,username and password? which is checks in database? Suppose the second page also if we want to verify
Explain url encoding in servlet?
What must be implemented by all servlets?
Explain the steps involved in placing a servlet within a package?
What are some disadvantages of storing session state in cookies?
What methodology can be followed to store more number of objects in a remote server?
Write the code to get the server information in servlet.
What are the differences between the servletconfig interface and the servletcontext interface?
I have a requirement Here we have a ResultSet object that will contain 50 records i need to print those recors in to a webpage(i.e; view according to MVC architectures that mybe servlet or jsp) . Here i need to print the records 10 per page that is 1 to 10 in page one and 11 to 20 in page two like remaining will be appeared in other pages we need to display those page numbers whenever we click on that page number we will go to that page and display 10 records like we will display 5 pages it is like this << 1 2 3 4 5 next >>
What are the steps involved in placing a servlet within a package?
What is servlet and list its types?