Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

JSP forward/redirect

  Asked By: Bailey    Date: Oct 12    Category: Java    Views: 1626
  

In the web application that I am working on ... the old folks used
struts like architecture. Controller Servlet forwarding to different
actions (do's), and these actions in tern forwards to different JSPs
or other actions (do's). Since they forward, the browser address bar
value (URL) does not change. [CASE1]

On the other hand, some of the JSP pages are submitting the forms
specifying the their actions (do's). In this case since the form was
submitted direct, the browser address is changed. [CASE2]

NOW, if the user hit REFRESH, behavior is different in CASE1 and
CASE2.

Here is the issue that got me started on this -

1. showList.do -> shows all the pages and books.
2. I select a book and hit PASTE. This is CASE2 (direct form submit)
and therefore the browser address bar changes to pastePage.do.
3. Since I did not select any page, it comes back with ERROR (No page
selected).
4. The user hits REFRESH, it again calls pastePage.do, and the error
just does not disappear.

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Fabiola Ferrrari     Answered On: Oct 12

What is the right behavior? Going back  to the page  where the html form  is? If so, refresh  does look like doing the job. You may want to handle this in the error  page with a small script such as history.back() (double check this. I am like Leo you know, no memory!)

 
Didn't find what you were looking for? Find more on JSP forward/redirect Or get search suggestion and latest updates.




Tagged: