Which method must be used to encode a URL passed as an argument to HttpServletResponse.
sendRedirect when using URL rewriting for session tracking?
A.
ServletResponse.encodeURL
B.
HttpServletResponse.encodeURL
C.
ServletResponse.encodeRedirectURL
D.
HttpServletResponse.encodeRedirectURL
D is the correct answer !
http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletResponse.html
I would have answered B, because the redirect use is not specified in the question
the question explicitly states the use of sendRedirect()