Answer Posted / paidi
Yes, It can possible to create the constructor inside the
servlet , it wont give any exception or error for creation
and it compile properly. But, Servlet initialization will
done by container. Container calls the init() to
initialize the servletconfg obj. No Use to write the
constructor inside the servlet.
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What are the important functions of filters?
Servlet is pure java object or not?
What is the servlet?
What's the difference between authentication and authorization?
What do you mean by a filter and how does it work?
What’s the difference between sendredirect and forward methods
Why do we need a constructor in a servlet if we use the init method?
What is cookie? Why is cookie used?
What is servlet in simple terms?
Can we use the constructor, instead of init(), to initialize servlet?
Explain the servlet context.
How can we implement a jsp page?
What is meant by servlet? What are the parameters of the service method?
What is getservletcontext?
What are session variable in servlets?