Hi,

I tried to use sendRedirect() with a link that has several parameters
but I saw that nor all the parameters were being passed for the other
page. Then I tried with forward() and it worked very well.
For example:
...
RequestDispatcher rd = getServletContext().getRequestDispatcher("url");
// ped = HttpServletRequest, resp = HttpServletResponse
rd.forward(ped, resp);
return;
...

Regards,
Fabio Martins


> Date:          Sun, 30 Dec 2001 12:34:34 -0700
> Reply-to:      "A mailing list for discussion about Sun Microsystem's Java           
>    Servlet API Technology." <[EMAIL PROTECTED]>
> From:          "[Ch.Suresh Babu]" <[EMAIL PROTECTED]>
> Subject:       res.sendRedirect method in servlets
> To:            [EMAIL PROTECTED]

> Hi ,
> I'm new to servlets.
> I'm writing a small program using servlets.In that servlet I'll fetch results from 
>the database.Based on the results I'll redirect a html page.
>  for that I used this code.
>    If(rs.next())
>    {
>    System.out.println("Before redirecting page1.html ");
>    res.sendRedirect("page1.htnl");
>    System.out.println("after redirecting page1.html ");
>     }
>    else
>    {
>      System.out.println("Before redirecting page2.html ");
>      res.sendRedirect("page2.htnl");
>      System.out.println("after redirecting page2.html ");
>     }
> I'm not getting any errors.
> But it's not redirecting to any page.but the out put statements are executing .
> What should i to to redirect to page.
> Thanks
> suresh

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to