Aureliano Calvo wrote:

> Hi,
> Is there any way of creating java beans with scope=request in a servlet, so
> that I can then redirect to a JSP? I want to pass objects from a servlet to
> a JSP, but without using the session. I know this can be done with the
> RequestDispatcher, but the url in the browser remains as the servlet.
> Thanks,
>

If you do a redirect to a JSP, instead of a forward, you are asking the browser to
send a *second* request (plus paying the time price for the extra round trip across
the network).  Thus, anything you want to pass to the JSP page will need to be a
session attribute instead of a request attribute.  Request attributes work with
RequestDispatcher.forward() because it is the *same* request.

IMHO, the "location" shown in a browser is totally irrelevant in a web application,
as opposed to when you are browsing a web site.  If it bothers you (or your users),
run the main part of your app inside a frame (or use Javascript to open a window
with no location bar) to make the URLs invisible.

>                                                                 Aureliano Calvo
>

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