Could you use the HTML <base> tag here?  You could have it conditionally
generated to control its value in development, production, etc.

----- Original Message -----
From: David Wall <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 06, 2000 9:19 PM
Subject: JSP -> servlet -> JSP request scope object passing


> This is no doubt a common question, but if I have a JSP page, that does =
> a FORM POST to a servlet, and that servlet's job is to do some parameter =
> checking, invoke the correct operations on beans/EJBs, then redirect the =
> user to the correct JSP page to display the results.
>
> If there's an error, the servlet sends the request back to the calling =
> page with an error set.  If all's okay, it generally takes the person to =
> another JSP, though it may come back to the original JSP with a =
> "success" message.
>
> This JSP -> servlet -> JSP must a fairly common use.
>
> I'm having trouble getting this to work using "request" scoped beans.  =
> When the first JSP is invoked, the request-scoped beans are created =
> until the page is returned.  Then when the user clicks on the submit =
> button, the POST goes to my servlet.  My servlet can create the beans =
> (such as an error response bean, and a page-specific bean that stores =
> the user's input so they don't have to re-enter anything if there's an =
> error), but if it puts them in the request object, a sendRedirect() will =
> cause the beans to be lost (new request).  If I use the =
> requestDispatcher.forward() call, the beans are remembered, but the base =
> URL remains the servlet's URL, not the JSP page that is displayed.
>
> Aside from using session beans (which easily breaks down if the user is =
> actively moving about your site in two or more windows), how are people =
> handling this?
>
> Thanks,
> David
>
>
===========================================================================
> 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
>

===========================================================================
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