| Author |
jsf equivalent code
|
lynn fann
Ranch Hand
Joined: Oct 15, 2006
Posts: 115
|
|
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
Joined: Jun 25, 2001
Posts: 14491
|
|
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.
|
Customer surveys are for companies who didn't pay proper attention to begin with.
|
 |
lynn fann
Ranch Hand
Joined: Oct 15, 2006
Posts: 115
|
|
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
Joined: Jun 25, 2001
Posts: 14491
|
|
OK, for that, an exact page URL isn't necessary, so you should have no problems.
This may help:
|
 |
Kiran Shirali
Ranch Hand
Joined: Jan 26, 2009
Posts: 34
|
|
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
|
SCJP 1.6 86%, SCWCD 5.0 on
|
 |
lynn fann
Ranch Hand
Joined: Oct 15, 2006
Posts: 115
|
|
hi guys,
thanks for your help.. it solve my problem
|
 |
 |
|
|
subject: jsf equivalent code
|
|
|