JSF URLs are more what I call "conversation handles" than absolute indicators of what page will be displayed. The same page URL that you originally jumped to may still be in use when that page navigates to the next page.
This is one of JSF's major annoyances, since it means you can't bookmark pages, and it's something that JSF 2.0 is supposed to address. In the mean time, I've had very good results using PrettyFaces to make bookmarkable URLs for JSF.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
I need to get the URL, from the url, it will tell my the environment that my apps is in (production or uat).. because in different environment, i need to present different things..
OK, for that, an exact page URL isn't necessary, so you should have no problems.
This may help:
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.