You work as a Software Developer for UcTech Inc. You want to create a new session. Which of the following methods can you use to accomplish the task?
Each correct answer represents a complete solution. Choose all that apply.
The getSession() method of the HttpServletRequest interface returns the current session associated with the request, or creates a new
session if no session exists. The method has two syntaxes as follows:
public HttpSession getSession(): This method creates a new session if it does not exist.
public HttpSession getSession(boolean create): This method becomes similar to the above method if create is true, and returns the
current session if create is false. It returns null if no session exists.
Answer B is incorrect. The getSession(false) method returns a pre-existing session. It returns null if the
client has no session
associated with it.
Answer A and E are incorrect. There is no such method as getNewSession() in Java.
Reena
6 months agoBlondell
6 months agoDenise
6 months agoPhuong
7 months agoDianne
7 months agoPolly
7 months agoPaola
7 months agoAlisha
8 months agoSelma
8 months agoShaquana
8 months agoCarma
8 months agoEulah
8 months agoDalene
8 months agoMerilyn
8 months agoPhil
8 months agoTamesha
8 months agoCassi
8 months agoVon
8 months ago