Can we write a constructor for a Servlet class ? if yes how ?
if no why not ?
Answer Posted / chandra
constructor required, but it should be public no-argument
constructor. even though if you are not write that
constructor java compiler will create that construtctor by
default. for that your servlet class should be public other
wise you will get RuntimeWxception saying RequestedResource
is not available like that.
| Is This Answer Correct ? | 9 Yes | 2 No |
Post New Answer View All Answers
Why session tracking is needed?
What is the type of method for sending request from http server?
When servlet is loaded?
How can the referrer and the target urls be used in servlet?
How can we refresh automatically when new data is entered into the database?
What do you mean by web applications?
What do you mean by deployment descriptor?
Should I override the service() method?
What is ServletConfig object?
What are the functions of Servlet container?
How do you find out what client machine is making a request to your servlet
Explain the features are in servlet 3?
What is the major difference between servlet and applet?
Is it good idea to create servlet constructor?
What exactly are the functions of servlet?