aspose file tools*
The moose likes JSF and the fly likes jsf application with two different start page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "jsf application with two different start page" Watch "jsf application with two different start page" New topic
Author

jsf application with two different start page

D. Formenton
Ranch Hand

Joined: Mar 20, 2008
Posts: 47
Hi,

is it possible to configure a JSF application so that it can begin execution calling (in the address bar of browser) one of two different .xhtml pages?
I tried to put the two pages into the welcome-file-list but only the first one works.

Thank you.

Domenico
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16246
    
  21

Actually, the precise functionality is that the first resolvable resource is the one that will work. So, for example, if the welcome list includes index.html and index.jsp but no index.html file exists, the index.jsp will be used.

To select a welcome page, you must first know whom you are welcoming. Since an initial unqualified URL request doesn't have much context, this can be challenging. If you make a welcome JSP and attach some support logic to it, you can forward to another welcome page based on something like the requester's IP address or possibly a cookie value from a previous session.

Note that because the welcome page is executed by the container and not the webapp, ".xhtm' (JSF) welcome pages may not work, so in such cases, a forwarding HTML or JSP would be required even if everyone had the same welcome page.


Customer surveys are for companies who didn't pay proper attention to begin with.
D. Formenton
Ranch Hand

Joined: Mar 20, 2008
Posts: 47
Thank you Tim.

As, in my case, the two welcome pages are (and must be) totally independent, I realize that the best way to solve the problem is to create two JSF applications over the same database, instead of merge multiple logic (and independent) path in the same application.

Again thank you.

Domenico
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: jsf application with two different start page