The getSession() method with 'true' as its parameter [ getSession(true) ] it will return the appropriate session object when

Options
- the session is completed
- the session object is passed to another method
- the session does not exists
- the session is existing


CORRECT ANSWER : the session is existing

Discussion Board
getSession()

getSession() method is a part of HTTP which is in itself a stateless protocol. It doesn't provides a way for a server to recognize which client is using what part of the application. It provides the access only once and doesn't save the state. getSession() method has the value as true only when the session is existing. It requires an application to keep track of the clients performing actions, and support API functionality which a plain http doesn't provide. Session can be tracked by providing an HttpSession object. getSession() method is accessed by calling a session of request object. The current session can be called by using the associated method if the request doesn't have a session.

Rohit Sharma 11-27-2014 04:54 PM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement