• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsf equivalent code

 
lynn fann
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in JSP i have the code:
RequestResponse rqrp = new RequestResponse(request, null);
String fullURL ="";// rqrp.getFullURL("");


In JSF, how to do i do it? I need to get the full URL of the application on the server.

Thanks.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18281
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you want the URL?

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.
 
lynn fann
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..

for example my url may look like this:
uat environment: http://servername/appuat/appinstance/
production environment:http://servername/appinstance/

Any alternative i can get the URL?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18281
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, for that, an exact page URL isn't necessary, so you should have no problems.

This may help:


 
Kiran Shirali
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Maybe this will also help. To get the point of execution on server i use the following on my JSF page:




Say i want to navigate to a relative url (a view page of NewPage.xhtml):




So maybe you can use something like:



This would allow you to set somethings only if the path is equivalent to your uat environment.

I hope this helps.

Kiran
 
lynn fann
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys,

thanks for your help.. it solve my problem
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic