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.
Afton
4 months agoRonny
3 months agoKarol
3 months agoMozelle
3 months agoLisandra
3 months agoSol
4 months agoMireya
3 months agoNakita
3 months agoWilliam
3 months agoBuffy
4 months agoIrene
4 months agoWei
4 months agoJamey
5 months agoJennifer
5 months agoCaren
5 months agoEstrella
3 months agoDawne
3 months agoVincenza
3 months agoShelba
3 months agoFelice
3 months agoVernice
3 months agoViola
4 months agoStephen
4 months agoRoselle
4 months agoEleni
4 months agoStevie
5 months agoRoyce
5 months agoSherita
4 months agoMireya
5 months agoAlfreda
5 months ago