• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Please help me to understand.

 
Jaik Singh
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

=================================

<display-name>PopUp</display-name>
<welcome-file-list>
<welcome-file>index.jsf</welcome-file>
</welcome-file-list>

<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>

<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>

=============================================

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
Pie
Posts: 18282
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jaik Singh
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Tim, will remember your suggestion by next time.

Thanks for your reply. Really helped.

Thanks
Jaikrat Singh
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic