Hi Joe,
When you use URL rewritting for session tracking and you send a URL which references your site to the client, you will use these 2 methods.
The difference between these 2 is:
1) You use "public String encodeURL(String url)" to the situation when the URLs are embedded in the web page that the
servlet generates, eg.
String oldURL = "/somepackage/someservlet1";
String newURL = response.encodedURL(oldURL);
out.println("<A HREF=\"" + newURL + "\">go here</A>");
2) You use public String encodeRedirectURL(String url) to the situation that you use a URL that refers to resource which you will use sendRedirect call. eg.
String oldURL = "/somepackage/someservlet2";
String newURL = response.encodedRedirectURL(oldURL);
response.sendRedirect(newURL);
Hope this helps you understand these 2 methods.
Tong Chen (Seattle USA)<br />SCJP,SCWCD,SCDJWS,IBM XML,MCP.NET,MCAD.NET,MCSD.NET