Difference between using getSession(true) and getSession(false) methods

What is the difference between using getSession(true) and getSession(false) methods?

- getSession(true) will check whether a session already exists for the user. If yes, it will return that session object else it will create a new session object and return it.

- getSession(false) will check existence of session. If session exists, then it returns the reference of that session object, if not, this methods will return null.
Difference between a JavaBean from a Servlet
Servlet and JavaBean - Servlets are Java based analog to CGI programs, implemented by means of a servlet container associated with an HTTP server...
How servlets differ from RMI
Servlet and RMI - RMI (Remote Method Invocation) are a means of client server communication. In this, the client invokes a method on the server machine..
Servlet servlet mapping - Define servlet mapping.
Servlet servlet mapping - Servlet mapping controls how you access a servlet. It is recommended that you don’t use absolute URLs. Instead usage of relative URLs should be done...
Post your comment