• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to get the whole URL like http://localhost:8080/webcontext/page.jsf?event=23&lang=1 in add bar

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends,
I have been facing a serious problem , Please help me out.
Problem :

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.

Thanks and Regards

Navdeep Singh (Kanwal Ror)
Sofware Developer
 
Saloon Keeper
Posts: 27808
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Navdeep Singh kanwal
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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??
 
Tim Holloway
Saloon Keeper
Posts: 27808
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can, I have, and it was using JSF1.2.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic