Reply To: Get view-id from arbitrary pretty-url

Splash Forums Rewrite Users Get view-id from arbitrary pretty-url Reply To: Get view-id from arbitrary pretty-url


IMHO you should go with your second option, meaning you should use a plain anchor element. I don’t think there is a really easy way to translate a clean URL to a view-ID without executing a complete rewriting lifecycle. And I don’t see any reason why you should use h:link instead if you already have the “clean-URL”. Wouldn’t it be weird to use some complex code to calculate the view-id for a clean-URL just to be able to use h:link which internally reverses this process by translating the view-id back to the clean URL?

BTW: I know this sounds silly, but you could also use JavaScript to go back in history. Something like history.back(); for example. If you are consistently using Rewrite and the POST-Redirect-GET pattern, this should work fine. That’s one of the nice benefits you are getting from Rewrite/PrettyFaces: The BACK-Button will work as expected. 🙂