Difference between encodeURL and encodeRedirectURL

后端 未结 2 465
春和景丽
春和景丽 2021-01-07 21:04

The javadoc for javax.servlet.http.HttpServletResponse is a little vague on the difference between what rules encodeURL and encodeRedirectURL

2条回答
  •  甜味超标
    2021-01-07 21:46

    encodeURL() is used for all URLs in a servlet's output. It helps session ids to be encoded with the URL.

    encodeRedirectURL() is used with res.sendRedirect only. It is also used for encoding session ids with URL but only while redirecting.

提交回复
热议问题