aspose file tools
The moose likes JSF and the fly likes jsf equivalent code Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "jsf equivalent code" Watch "jsf equivalent code" New topic
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
    
    7

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
    
    7

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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: jsf equivalent code
 
Similar Threads
example of source code for insert a date
Redirect in a JSF page itself dependent on which panelGrid is rendered:
How can i implement security in field level
Can I add JSF components through Ajax?
AJAX and Flash