Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

back button

 
pooja jain
greenhorn
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the good way to implement back button?

one is history.go(-2), it looks good at first go. but there is an issue here:

it just shows the back page from browser history. this is what it is supposed to do.

but consider this scenerion:



assume there is a form and submit button on above page. now what happens is, in case of any invalid form field, we set error attribute to request, and we forward request to same page, and since request attribute is set, we will get this error message.

now user correct the form and submit again. this time no error so user go to next page. now on this next page there is a back button. if user clicks on it user will see the previous page with error. this is definitely wrong.

any suggestion here?
[ November 07, 2008: Message edited by: pooja jain ]
 
Satya Maheshwari
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could consider using to prevent caching of page:



Please see: http://www.theserverside.com/discussions/thread.tss?thread_id=11078
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Satya Maheshwari:
You could consider using to prevent caching of page:



Please see: http://www.theserverside.com/discussions/thread.tss?thread_id=11078


yes.. it is good. also maintain the session according to your needs
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic