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 is the difference between get and post methods?
What is the structure of the http response
What is the use of servlet context?
Can we use threads in Servlets?
Is it good idea to create servlet constructor?
Why do we need a constructor in a servlet if we use the init method?
How can we invoke another servlet in a different application?
What is the major difference between context parameter and context attribute?
Elucidate servlet attributes and its scope?
When should you prefer to use doget() over dopost()?
How do you design microservices?
Can you call a jsp from the servlet?
What do you mean by session tracking?
What is called Session Tracking?
What are the important functions of filters?