tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manea Mirko <m...@arena.sci.univr.it>
Subject Re: Redirect and cookies
Date Wed, 24 May 2000 13:32:14 GMT
On Wed, May 24, 2000 at 10:09:40AM -0300, Luiz Borba wrote:
> Hi,
> 
> 
> I had the same problem... Use <jsp:forward page="...">, not sendRedirect ! Ok ?
> 

the problem is that I am using it from a servlet not from a jsp page... 
is there any other way to forward from a servlet to specific url ?

thank you

> 
> Luiz
> 
> 
> Em qua, 24 mai 2000, you wrote:
> > Hi,
> > 
> >    switching from jserv 1.1 to tomcat 3.1 I found that the following snippet
> > of code doesn't work any more:
> > 
> > String name = "foo";
> > String value = "admin";
> > if (name != null && name.length() > 0) {
> >     Cookie c = new Cookie(name, value);
> >     c.setMaxAge(4*60*60);
> >     c.setVersion(0);
> >     c.setPath("/");
> >     response.addCookie(c);
> >     response.sendRedirect(response.encodeRedirectURL("http://www.mysite.com"));
> > }
> > 
> > The problem is that if I try to set a cookie and then call 
> > response.sendRedirect, the cookie is not set at all. 
> > If I comment out the last line of code, the cookie is set. 
> > Is this a tomcat problem ? With jserv 1.1 this code worked fine.
> > 
> > Thanks very much,
> > 		Mirko Manea
> > 
> > --------------------------------------------------------------------------
> > To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commmands, email: tomcat-user-help@jakarta.apache.org
> -- 
> Luiz Borba
> Diga-me.com
> 
> 
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org

-- 
Best Regards,
      Mirko Manea <mami@mami.net>
      URL: http://www.mami.net

  /**********************************\
  | NEW email address: mami@mami.net |
  \**********************************/

Mime
View raw message