title: Refreshing URL with JSF ajax request
body: <p>I'm using JSF 2 with PrettyFaces and also the <code>&lt;h:link&gt;</code> and <code>&lt;f:param&gt;</code> tags extensively to get bookmarkable pages (It's great to finally forget about all those POST request in a JSF application).</p>
  
  <p>However, some of these links only changes a small part of the page (mainly when the user stays in the same view), so it's nicer to send ajax requests instead. However, <code>&lt;f:ajax&gt;</code> cannot be used with <code>&lt;h:link&gt;</code>, just <code>&lt;h:commandlink&gt;</code>. I can send parameters many ways with a commandlink as well, but in this case the URL stays the same after the request. So it becomes out of sync with the content of the page, and it's not refreshable.</p>
  
  <p>I've seen sites that use links that send kind of a mixture of GET and ajax requests (pointing to a new url while modifying the page with ajax), but so far I haven't found any solution.</p>
  
  <p>Can I somehow refresh the url with jsf after the ajax request finishes (or when the user clicks)? Or do I have to use some external JS library?</p>
  
  <p><strong>EDIT</strong>: The JS library that is needed here is the new JavaScript History API. <a href="http://html5doctor.com/history-api/" rel="noreferrer">More info.</a>
  I guess JSF does not use this API currently. But I'm still interested in this issue from a JSF developer's point of view.</p>
  
  <p>Also, is it planned for a future release of JSF? Combining <code>&lt;f:ajax&gt;</code> with <code>&lt;h:link&gt;</code> would be a perfect solution.</p>