aspose file tools*
The moose likes JSF and the fly likes .web.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark ".web.xml" Watch ".web.xml" New topic
Author

.web.xml

Dura Hurtado
Ranch Hand

Joined: Feb 16, 2011
Posts: 120
Hi, if I type in my index.jsp : <%response.sendRedirect("about_us.jsf"); %>

and in the .web.mxl I type:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>bh</display-name>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>

My question is: if I have several files "about_us.jsp", "about_us.html", "about_us.xhtml". ¿JSF takes just the name and redirects by default to .jsp?.

I ask this because I have test it and if I only have .jsp file it works properly , but if I delete it I put a .html file, it doesn´t find it.

¿Anybody knows what way it works?

Thanks
leo donahue
Ranch Hand

Joined: Apr 17, 2003
Posts: 327
Set your context param javax.faces.DEFAULT_SUFFIX to whatever suffix you want. Why do you want several suffixes?


Thanks, leo
Dura Hurtado
Ranch Hand

Joined: Feb 16, 2011
Posts: 120
leo donahue wrote:Set your context param javax.faces.DEFAULT_SUFFIX to whatever suffix you want. Why do you want several suffixes?



Yes, that kind of answer I needed. Thanks.
 
Consider Paul's rocket mass heater.
 
subject: .web.xml