Which of the following lines of code, in the doPost() method of a servlet, uses the URL rewriting approach to maintaining sessions? (Choose one)

Which of the following lines of code, in the doPost() method of a servlet, uses the URL rewriting approach to maintaining sessions? (Choose one)





a. out.println("<a href=' "+response.encodeURL("/servlet/XServlet")+" '>Click here</a>"));
b. out.println("<a href=' "+request.rewrite("/servlet/XServlet")+" '>Click here</a>"));
c. out.println(response.rewrite("<a href='/servlet/XServlet'>Click here</a>"));
d. request.useURLRewriting();

Answer: A


Learn More :