JSP redirect loses session

I'm using,response.sendRedirect(encodedUrl);to redirect to another JSP but it trashes my session. I'm using a bean with a scope of session but after the redirect the session is always lost.Anybody got any ideas?Many ThanksJ-P
[276 byte] By [janquetil] at [2007-9-26 3:29:25]
# 1
hi,try with <jsp:forward page="next.jsp"/>hope this helps !Badr.
zbadr at 2007-6-29 11:54:02 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Thanks, I'll give it a try.J-P
janquetil at 2007-6-29 11:54:02 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

encodeRedirectURL

public java.lang.String encodeRedirectURL(java.lang.String url)

Encodes the specified URL for use in the sendRedirect method or, if encoding is not needed, returns the URL unchanged. The implementation of this method should include the logic to determine whether the session ID needs to be encoded in the URL. Because the rules for making this determination differ from those used to decide whether to encode a normal link, this method is seperate from the encodeUrl method.

All URLs sent to the HttpServletResponse.sendRedirect method should be run through this method. Otherwise, URL rewriting canont be used with browsers which do not support cookies.

After this method is called, the response should be considered to be committed and should not be written to.

Parameters:

url - the url to be encoded.

Returns:

the encoded URL if encoding is needed; the unchanged URL otherwise.

v_senthilraja at 2007-6-29 11:54:02 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

(2) encodeRedirectUrl

public java.lang.String encodeRedirectUrl(java.lang.String url)

Deprecated. Use encodeRedirectURL(String url)

Encodes the specified URL for use in the sendRedirect method or, if encoding is not needed, returns the URL unchanged. The implementation of this method should include the logic to determine whether the session ID needs to be encoded in the URL. Because the rules for making this determination differ from those used to decide whether to encode a normal link, this method is seperate from the encodeUrl method.

All URLs sent to the HttpServletResponse.sendRedirect method should be run through this method. Otherwise, URL rewriting canont be used with browsers which do not support cookies.

Parameters:

url - the url to be encoded.

Returns:

the encoded URL if encoding is needed; the unchanged URL otherwise.

v_senthilraja at 2007-6-29 11:54:02 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...