Answer Posted / sanjay sah
Yes, we can create constructor for servlet but that one
should be public no-args constructor.
If we do not create then compiler itself takes care for
it.Servlet container creates instance of servlet by invoking
public no-agrs constructor.
Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
How can we implement a jsp page?
What is http servlet? Explain with the help of an example.
What mechanisms are used by a Servlet Container to maintain session information?
What is the difference between forward () and sendredirect () functions in servlet? Explain
How we can call a jsp from the servlet?
What are the differences between the servletconfig interface and the servletcontext interface?
What is the importance of init() method in Servlet ?
Explain the role of dispatcherservlet and contextloaderlistener.
What do you mean by scope object and what are its types?
How to get ip address in jsp login page and how to validate like 127.1.0.1 all should not be greater than 255
What is the difference between Servlet Request and Servlet Context when calling a Request Dispatcher?
What is the difference between get and post methods?
Differentiate between get and post?
Does servlet have main method?
What is called servlet container?