Marco M wrote:

> hi all,
>         i have a problem:
> i am using Model 2 architecture...and for sending back the jsp page i use
> RequestDispatcher.forward()..
> however, i am having errors with some WebServers when i use the
> 'RequestDispatcher' technique..
> the point is that i want to set some Attributes in the request..
> let's say
> -----
> request.setAttribute("mylist", mylist);
> requestdispatcher.forward(request, response);
> -----
>
> how can i have the same functionality using response.sendRedirect??? as far
> as i know, in the response u cannot set any attributes
>
> anyone can help me??

You cannot pass request attributes when using response.sendRedirect() because of
what actually happens --  the servlet container tells the browser to submit a
*second* request (not the same one as with RequestDispatcher.forward()) to the new
URL.  If you are using response.sendRedirect(), the only reasonable way to save
information across requests is to store them in a user's session.

>
> thanx in advance & regards
>         marco
>

Craig McClanahan

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to