• 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

jsf equivalent code

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, for that, an exact page URL isn't necessary, so you should have no problems.

This may help:


 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi guys,

thanks for your help.. it solve my problem
 
And tomorrow is the circus! We can go to the circus! I love the circus! We can take this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic