Hi,

<snip>

>I can't use HTTP header referer because this changes from "StepA.jsp" to
>"StepA.do" after the RequestDispatcher.forward(). That is to say, it works
>once but then after that creates an endless loop referring to itself.

Do you forward to the JSP page? I would say..if an error occurs, you forward
BACK to the page that submitted it. Thus, your forward to StepA.jsp and put
the exception in the REQUEST object before forwarding, maybe in some
attribute, as I do (request.setAttribute("EXCEPTION", e.getMessage()). Then,
on the JSP page, I display the message sent back, and it shows the form
again. If you are working with a single form, there is no real need to use
session scope. Just do like you said..introspect the request object into the
javabean, then attach the bean to the request object when forwarding back
(if an error occurs) (setAttribute("MyBean", myBean); IN the JSP page, do
the <jsp:useBean id="MyBean" scope="request" class="com.package.MyBean" />
Thus..your bean only exists as long as the request..and the servlet engine
cleans up the object out of the request for you..so your not keeping an
object around and have to remove it from the session yourself (if you were
using session scope). On a multi-page form, you'll have to use session scope
however to keep the data around.

I asked the very same question...when I submit a form with a .do, the web
URL line shows the .do in it. However, as Craig and Daniel both pointed
out..once the user is on your site..the URL line shouldn't matter. They
could hide it if they wanted..it means nothing. Your home page starts the
application and from then on they shouldn't bookmark any pages nor care what
the web browser URL line shows.

If I am missing something..please elaborate.

Thanks.

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