I have been facing a serious problem , Please help me out.
Currently we have url somewhat like:
http://localhost:8080/webcontext/page.jsf it does not change with page change, As we do not have individual page Because we fetch the data from db on clicking of menu and it gets rendered in the page internally.
we want that when user clicks some menu the url changes automaticall according to the required values like we have here below:
http://localhost:8080/webcontext/page.jsf?event=23&lang=1 So that i can let the user to go forward and backward from the browser buttons.
I have solution for this but that does not seem to be satisfied
Solution : i have redirected the page to this customized url on every click, i use to build the url on my own after clicking the menu,
Can i have any better solution Becuase it is creating some performance issues, becuause its redirects property.
In JSF, the URL is not so much a page locator as it is a session "handle", which is why it doesn't track directly to views.
Trying to work directly brute-force with URLs in JSF can be a problem, however. Quite aside from the fact that they make even getting the URL difficult (JSF is built on an abstraction and doesn't assume that the app is always based on the web or servlets). JSF makes extensive use of form postbacks, which are HTTP POST-based, so the same logic that got entered originally via an HTTP GET may spend most of its life dealing with POST.
All is not lost, however. JSF2 added better support for "bookmarkable" JSF URLs. Also, you can install and use the PrettyFaces add-on from OCPsoft (ocpsoft.com), which I think is a subsidiary of Red Hat JBoss these days. At least Lincoln Baxter, who created PrettyFaces (and occasionally visits here) works for JBoss these days.
PrettyFaces makes bookmarkable URLs trivial. You basically add a small jar to WEB-INF/lib, put in a minor addition to web.xml, and add annotations to the backing beans that you want to have bookmarkable URLs. Or, if you prefer, use the legacy pretty-config.xml file.
PrettyFaces works on the idea that you provide a URL template that allows you to define a simple bookmarkable URL in the format you want, plus optional URL parameters which are mapped to backing bean properties. Once you do that, the actual Java code becomes POJO: the URL fires an action method, and when the action is invoked, the URL parameters have been pre-injected into their corresponding bean properties automatically.
However, I don't think that a bookmarkable URL alone is going to resolve issues with the forward and back browser buttons. That's a whole different can of worms.
An IDE is no substitute for an Intelligent Developer.
Navdeep Singh kanwal
Joined: Dec 19, 2011
So you mean we do not have any solution in JSF1.2.
I have one more question:
Can i Use PrettyFaces As i am using RichFaces Already in my project??