2

I am a beginner of Prettyfaces, so please forgive me if I missed something really basic.

My url-mapping contains a EL-injected path parameter. The parameter value could be changed by user through selecting a drop down list item.

My question is: since it's an ajax call, the view id didn't change, so if I bookmark the url, the value still contains the original parameter value instead of the user update one. How do I get the browser addressbar url updated based on user's action?

1 Answers1

0

There are two solutions here. You can respond to the AJAX request with a 302 Temporary Redirect, e.g: response.sendRedirect("/new/location") - usually done through JSF navigation.

Or, when the AJAX response comes back, you can use the JavaScript HTML5 push-state history API (if the browser supports it) to update the address directly: Good tutorial for using HTML5 History API (Pushstate?)

Community
  • 1
  • 1
Lincoln
  • 3,027
  • 15
  • 22