Ray Tayek wrote:

i was using getRequestDispatcher(). but i have changed that to use redirect (which works, but may cause me some problems later with session - not sure, but i want to have the guy stay in that same sessiosn even if goes off and looks at a static page - i am worried about people who don't allow cookies and if i don't do some kind of url encoding on the static file i may get hosed - maube i should just copy it througt the servlet?).

There is a method of HttpServletResponse called "encodeRedirectURL" for this, so that when you redirect to another page, the session is maintained:


(in the "doGet" method of a Servlet:)

  // redirect to "somepage.jsp" but
  // preserve the session in the URL:
  String targetPage = "somepage.jsp";
  response.sendRedirect(
               response.encodeRedirectURL(targetPage));

But your suspicions are correct: if you redirect to a static page (non-JSP) at any point in your application and the user has cookies disabled, there is no way to encode the URLs on the static page to keep the user "in" the session.

Instead of redirecting to a static HTML page, make it a JSP and encode the URLs on it.


Erik



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to