41.How to create a session in servlet? You would get HttpSession object by calling the public method getSession() of HttpServletRequest, as below: // Create a session object if it is …
Servlet
- Interview Questions and AnswersServletsTechnical Interview Questions and Answers
- Interview Questions and AnswersServletsTechnical Interview Questions and Answers
Servlets Interview Questions and Answers For Freshers Part-4
by Sby S31.Can multiple filters be configured? Yes. 32.Can filtering be done in an ordered way? If so then how to achieve it? Yes. The order of filter-mapping elements in web.xml determines …
- Interview Questions and AnswersServletsTechnical Interview Questions and Answers
Servlets Interview Questions and Answers For Freshers Part-3
by Sby S21.How to send an authentication error from a servlet? We can use setStatus(statuscode) method of HttpServletResponse to send an authentication error. // Set error code and reason. response.sendError(407, “Need authentication!!!” …
- Interview Questions and AnswersServletsTechnical Interview Questions and Answers
Servlets Interview Questions and Answers For Freshers Part-2
by Sby S11.For what purpose destroy() method of a servlet is used? This method gives your servlet a chance to close database connections, halt background threads, write cookie lists or hit counts …
- Interview Questions and AnswersServletsTechnical Interview Questions and Answers
Servlets Interview Questions and Answers For Freshers Part-1
by Sby S1.What are Servlets? Java Servlets are programs that run on a Web or Application server and act as a middle layer between a request coming from a Web browser or …