Re: Redirection

Geeta Ramani <[email protected]>
Newsgroups gmane.comp.java.sun.servlet
Organization Central Maine Power Company
Message-ID <[email protected]>
Aasim:

Sure, just redirect to "samePage.jsp?error=myError". At the top of your
samePage.jsp, simply check to see if request.getParameter("error") is
true and if so display a JavaScript alert with the appropriate
message..  Of course if you use Struts, everything is easy..:)

Regards,
Geeta

Aasim wrote:

> Dear Servlet Interest users, I have an online ordering application.
> Whenever the user enters some data in the form, I check whether the
> information is valid or not (using information from a database) and
> depending on that, I redirect the user to the appropriate error
> page-using "response.sendRedirect(respectiveErrorURI)"
> function.However, the user has to use the back button on the browser
> and go back to the previous page and then correct the error and try to
> submit it again.Can I display the error message on the same page along
> with the form that he/she submits?Is there some way I can achieve
> this. I would appreciate any help in this regard. Thanks! --Aasim.
> -----------------------------------------------------------------------
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.