-
1. Re: URL rewriting by AjaxViewHandler
v.bannur Sep 7, 2012 8:36 AM (in response to v.bannur)Any one help me please?
-
2. Re: URL rewriting by AjaxViewHandler
healeyb Sep 11, 2012 6:34 AM (in response to v.bannur)There are a couple of established approaches to solving this problem:
1. Use PrettyFaces http://ocpsoft.org/prettyfaces/
2. If you have an apache web server fronting your application server you can use mod_rewrite to do anything you want
with URLs. Be warned though that despite being functional and fast the apache configuration was designed in hell
and has flames coming out of it, which is what happens to a lot of people when they first try to use it.
Perhaps of more use is the fact that JSF always shows the URL of the last page, not the current page. What you can
do is use a post-redirect-get pattern:
<h:commandButton action="login.xhtml?faces-redirect=true"/>
normally the browser would issue a POST request to the server when you click the button. With PRG the browser sends
a POST request followed by a GET request. With PRG if you refresh the page only the GET is resent avoiding potential
duplicate orders etc...
Regards,
Brendan.
Freelance Java Enterprise Developer
JSF Richfaces Ajax Java 6/7 (scjp) EE 6 HTML CSS JavaScript jQuery MySQL JPA Hibernate Eclipselink
Spring Oracle SQL JPQL Sybase EJB CDI Glassfish Apache JAX-RS Primefaces UNIX Paypal and more..
-
3. Re: URL rewriting by AjaxViewHandler
v.bannur Sep 10, 2012 6:22 AM (in response to healeyb)Thanks Brendanfor replying
You mean to say there is no soution from the custom view handler?
However I use faces-redirect=true for every navigation rule.
I heared there are few issues with prettyfaces and richfaces A4J components. thats the reason i was looking with custom viewhandler.