Given an HttpServletRequest request and an httpServletResponse response:
HttpSession session = null;
/ / insert code here
if (session = = null) {
/ / do something if session does not exist
} else {
/ / do something if session exists
}
Which of the code below is more appropriate to be inserted instead of the line that contains '/ / insert code here' ?
A. session = response.getSession ();
B. session = request.getSession ();
C. session = request.getSession (true);
D. session = request.getSession (false);
E. session = request.getSession (“jsessionid”);
If you want to solve the questions together with the experts and understand the concepts better, please contact us using the contact form or WhatsApp numbers. Selected people get to do that without any additional charges.