I'm working with JSF and PrettyFaces and I need to do the next thing. I have 4 buttons generated in an ui:repeat. Every commandButton sets an object in a Conversation Bean and then I have to navigate to another page and get the object that was set in the button clicked. It seems pretty simple but the problem is I need a PrettyFaces friendly URL in the browser.
Tests done:
If I put the xhtml resource as string in the return commandbutton action navigates correctly but the URL points to the xhtml resource, not to the pretty-faces friendly URL. (Ex: ...host/my-web/prices.xhtml)
If I put the friendly URL as string (/web/prices/) in the return commandbutton action is not navigating.
If I do a redirect as follows:
FacesContext context = FacesContext.getCurrentInstance(); HttpServletRequest request = (HttpServletRequest) context.getExternalContext().getRequest(); try { context.getExternalContext().redirect("/web/prices/");
It navigates correctly to the friendly URL but the conversation is not working because before I redirect I'm setting the object recived in the commandbutton action and when navigates this object in the conversation bean is null.
Any idea how to solve that?
Thanks in advance.