Browser back button messes up my jsf navigation

The navigation between two pages is ok when application-provided links are used. It's not ok when the browser back button is used.. Bear with me and I'll try to explain this as clearly as possible.

Page 1 is a search page where search criteria for items is entered. After the submit command button is clicked the page is redisplayed along with a list of search result links.

Page 2 displays an item edit page when a search result command link is clicked.

This scenerio works ok

1) page 1, enter criteria on search page

2) page 1, click submit command button

3) page 1, search page is refreshed with list of search result links

4) page 1, command link for item 12345 is clicked

5) page 2, edit page for item 12345 is displayed

6) page 2,click application provided link for navigating to search page

7) page 1, search page is redisplayed

8) page 1, enter new criteria on search page

9) page 1, click submit button

10)page 1, search page is refreshed with new list of search result links

This scenerio does not work ok

1) page 1, enter criteria on search page

2) page 1, click submit command button

3) page 1, search page is refreshed with list of search result links

4) page 1, command link for item 12345 is clicked

5) page 2, edit page for item 12345 is displayed

6) page 2,click back button

7) page 1, search page is redisplayed

8) page 1, enter new criteria on search page

9) page 1, click submit button

10)page 2, edit page for item 12445 is displayed, OUCH!

I believe this is what's happening after pressing the back button the browser is on page 1 but the server jsf session thinks it's still on page 2. So when the submit button on page 1 is pressed the server thinks it's from page 2 and since there are no changes it simply redisplays the page. Furthermore, no events are fired for the page 2 backing bean since there are no page changes.

What can I do to fix this back button problem. I would appreciate any help,

Regards,

Al Malin

[2155 byte] By [malinaaa] at [2007-10-3 1:30:11]
# 1
What implementation/version of JSF are you using?
rlubkea at 2007-7-14 18:28:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Thanks for the reply. It's JSF RI 1.1_01
malinaaa at 2007-7-14 18:28:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Hi,Have you fixed this problem ? I am realy despered to figured out what the issue is.Thanks a lotMichal
stachurskima at 2007-7-14 18:28:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
i too have the same implementation ...but instead of command link i am usingoutputlink<hx:outputLinkEx styleClass="outputLinkEx"......every thing works fine.Try changing to that or post the related code.-- raju>
rajureddya at 2007-7-14 18:28:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
Hi. Did anyone find a solution to this problem?
jeffrey.changa at 2007-7-14 18:28:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6

Its not the problem with the back button.

Are you holding some value in session based on which you are submitting the page ?

>So when the submit button on page 1 is pressed the server thinks it's from page 2

This is not true. Probably you are using the same Action method for both the submits and based on the value from session you are navigating to the pages.

Are you using CommandLink /CommandButton to submit ?

Akash_Gangaa at 2007-7-14 18:28:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...