You might try using the JSTL tags.  Something like this:

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>
<c:redirect url="widgets.do">
   <c:param name="jsessionid" value="${pageContext.session.id}"/>
</c:redirect>


Gary
-------------- Original message -------------- 

> Hi Michael 
> 
> In my case, I'm working with WAP applications that require the jsessionid to 
> be in the URL. In the case of Struts redirect forward it doesn't put the 
> jsessionid in the URL. When I browse using a WAP my session is lost in the 
> process. 
> 
> Regards, 
> 
> Néstor Boscán 
> 
> -----Mensaje original----- 
> De: Michael Jouravlev [mailto:[EMAIL PROTECTED] 
> Enviado el: Thursday, September 08, 2005 12:18 PM 
> Para: Struts Users Mailing List 
> Asunto: Re: Struts forward and jsessionid 
> 
> On 9/8/05, Néstor Boscán wrote: 
> > Hi 
> > 
> > How can I guarantee that Struts will send the jsessionid parameter 
> > with each forward with redirection?. 
> 
> Struts does not have to send session ID with forward, since forward occurs 
> on server only. Struts (actually, the servlet container) sends session ID to 
> browser when you create session on server. After initial handshake, session 
> ID is sent back and forth as a cookie if browser supports cookies. If not, 
> server rewrites all urls and includes session ID into them, so when you 
> click on link, session ID is sent back to server. 
> 
> JSP has session turned on by default. So even if you do not start session 
> explicitly, it will be started after first JSP is displayed. 
> 
> As application developer you do not need to care about this. This is a 
> problem of servlet container and browser. All you need, is to make sure that 
> session is established and is not recreated anew each time. 
> 
> Michael. 
> 
> --------------------------------------------------------------------- 
> To unsubscribe, e-mail: [EMAIL PROTECTED] 
> For additional commands, e-mail: [EMAIL PROTECTED] 
> 
> 
> 
> 
> --------------------------------------------------------------------- 
> To unsubscribe, e-mail: [EMAIL PROTECTED] 
> For additional commands, e-mail: [EMAIL PROTECTED] 
> 

Reply via email to