Java Servlet Interview Questions

Connect with

Java Servlet Interview questionsJava Servlet Interview Questions for all levels: servlet beginners, intermediate and advance user. Servlet frequently asked questions (Servlet FAQ).

Overview of Java Servlet Interview Questions

In the previous post JSP interview question and qnswer and in this post you find java srvlet FAQs interview questions for all level of interview.

what is differences between HttpServletRequest’s getSession(), getSession(true) and getSession(false) methods?

  • HttpServletRequest.getSession(): it returns the current HttpSession associated with this request, or if the request does not have a session, creates new one. If no bolean argument provide it means HttpServletRequest.getSession(true)
  • HttpServletRequest.getSession(true): it returns the current HttpSession associated with this request, if there is no current session, returns a new session.
  • HttpServletRequest.getSession(false): it returns the current HttpSession associated with this request, if there is no current session, returns null.

Reference

You can visit Oracle Java Official Docs for more details.

Thanks for visiting this post of servlet FAQ.
Happy Learning 🙂 for core Java with mySoftKey.com.

You can ask any question regarding the java servlet here in the comment section, I will try to reply to the answer to your question. Suggestions are welcome to improve the list of questions and to share the list of questions to include on this page.
Happy Learning servlet faqs interview question 🙂


Connect with

Leave a Comment

Your email address will not be published. Required fields are marked *