File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Please help me to understand. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Please help me to understand." Watch "Please help me to understand." New topic

Please help me to understand.

Jaik Singh

Joined: Sep 22, 2010
Posts: 20
Hey Guys,
Could you please make me understand the relationship between the few below entries in web.xml and the default URL generated when we deploy the application on the server.

Entries in web.xml



<servlet-name>Faces Servlet</servlet-name>

<servlet-name>Faces Servlet</servlet-name>



This config generate the default URL http://localhost:8080/PopUp/.

I have file, index.xhtml but to make this application run on browser I have to edit the URL and write http://localhost:8080/PopUp/index.jsf.

What should I need to changes in the above config so that if I deploy this application on browser the default URL generated should be http://localhost:8080/PopUp/index.jsf.

Thanks and Regards
Jaikrat Singh TARIYAL.

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

You'll get more answers if you pick a question topic that's more specific to your problem. Non-descriptive topics like "About JSF" or "Help me" don't get looked at as much.

As its name implies, "welcome-file" must be a FILE (WAR resource), not a URL.

Pages that are displayed by direct action of the webapp container, such as the welcome page, login/loginfail, and error pages don't get routed through the normal URL process. In particular, they don't go through the FacesServlet, so JSF cannot be used.

The way around that is to make the welcome-file be a straight HTML or JSP file that redirects to your JSF welcome page. It's annoying, but that's how it works.

An IDE is no substitute for an Intelligent Developer.
Jaik Singh

Joined: Sep 22, 2010
Posts: 20
Hey Tim, will remember your suggestion by next time.

Thanks for your reply. Really helped.

Jaikrat Singh
I agree. Here's the link:
subject: Please help me to understand.
It's not a secret anymore!