You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Behrang Saeedzadeh <be...@gmail.com> on 2005/07/10 09:29:09 UTC

Welcome File

Hi

I've a simple JSF application. As long as I can remember, it was possible  
to specify
a logical URI instead of as a physical file in the welcome file list in  
the 2.4 spec.

I have specified the index.jsf page to be the welcome page, but I'm  
presented with
the directory listing when I visit the homepage of my Web app, namely  
http://localhost:8084/JSF01/

The web.xml file is:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	 xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee  
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
	 version="2.4">
          <context-param>
             <param-name>javax.faces.CONFIG_FILES</param-name>
             <param-value>/WEB-INF/faces-config.xml</param-value>
         </context-param>
         <context-param>
             <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
             <param-value>server</param-value>
         </context-param>
         <context-param>
             <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
             <param-value>true</param-value>
         </context-param>
         <context-param>
             <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
             <param-value>false</param-value>
         </context-param>
         <context-param>
             <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
             <param-value>true</param-value>
         </context-param>
         <context-param>
             <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
             <param-value>true</param-value>
         </context-param>
         <listener>
             <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
         </listener>
          <servlet>
             <servlet-name>Faces Servlet</servlet-name>
             <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
             <load-on-startup>1</load-on-startup>
          </servlet>
          <servlet-mapping>
             <servlet-name>Faces Servlet</servlet-name>
             <url-pattern>*.jsf</url-pattern>
          </servlet-mapping>
          <welcome-file-list>
             <welcome-file>index.jsf</welcome-file>
         </welcome-file-list>
</web-app>

Any ideas?

Thanks in advance,
-- 
Behrang Saeedzadeh
http://www.jroller.com/page/behrangsa

Using Opera's revolutionary e-mail client

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Welcome File

Posted by Behrang Saeedzadeh <be...@gmail.com>.
Hi


> Question: Does it return a page if you request the index.jsf page  
> directly?

Yes. It renders the index.jsp JSF page successfuly on the screen.

- Behrang

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Welcome File

Posted by David Smith <dn...@cornell.edu>.
Question: Does it return a page if you request the index.jsf page directly?

--David

Behrang Saeedzadeh wrote:

> Hi
>
> Thanks for the reply.
>
>> I think the servlet mappipng should be ,
>>
>>         <servlet-mapping>
>>             <servlet-name>Faces Servlet</servlet-name>
>>             <url-pattern>/JSF01</url-pattern>
>>          </servlet-mapping>
>>
>
> I think this is not true. I remember when I was using Struts, my  
> ActionServlet's
> mapping was something like *.do or /do/* and putting index.do in the  
> welcome file list
> was working (I'm not sure, I've to check it once again...)
>
> Thanks,



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Welcome File

Posted by Behrang Saeedzadeh <be...@gmail.com>.
Hi

Thanks for the reply.

> I think the servlet mappipng should be ,
>
>         <servlet-mapping>
>             <servlet-name>Faces Servlet</servlet-name>
>             <url-pattern>/JSF01</url-pattern>
>          </servlet-mapping>
>

I think this is not true. I remember when I was using Struts, my  
ActionServlet's
mapping was something like *.do or /do/* and putting index.do in the  
welcome file list
was working (I'm not sure, I've to check it once again...)

Thanks,
-- 
Behrang Saeedzadeh
http://www.jroller.com/page/behrangsa

Using Opera's revolutionary e-mail client

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Welcome File

Posted by tomcat <to...@hoewerkteenauto.nl>.
Behrang Saeedzadeh wrote:

> Hi
>
> I've a simple JSF application. As long as I can remember, it was 
> possible  to specify
> a logical URI instead of as a physical file in the welcome file list 
> in  the 2.4 spec.
>
> I have specified the index.jsf page to be the welcome page, but I'm  
> presented with
> the directory listing when I visit the homepage of my Web app, namely  
> http://localhost:8084/JSF01/
>
> The web.xml file is:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
>      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee  
> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
>      version="2.4">
>          <context-param>
>             <param-name>javax.faces.CONFIG_FILES</param-name>
>             <param-value>/WEB-INF/faces-config.xml</param-value>
>         </context-param>
>         <context-param>
>             <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
>             <param-value>server</param-value>
>         </context-param>
>         <context-param>
>             <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
>             <param-value>true</param-value>
>         </context-param>
>         <context-param>
>             <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
>             <param-value>false</param-value>
>         </context-param>
>         <context-param>
>             <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
>             <param-value>true</param-value>
>         </context-param>
>         <context-param>
>             <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
>             <param-value>true</param-value>
>         </context-param>
>         <listener>
>             
> <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class> 
>
>         </listener>
>          <servlet>
>             <servlet-name>Faces Servlet</servlet-name>
>             
> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
>             <load-on-startup>1</load-on-startup>
>          </servlet>
>          <servlet-mapping>
>             <servlet-name>Faces Servlet</servlet-name>
>             <url-pattern>*.jsf</url-pattern>
>          </servlet-mapping>
>          <welcome-file-list>
>             <welcome-file>index.jsf</welcome-file>
>         </welcome-file-list>
> </web-app>
>
> Any ideas?
>
> Thanks in advance,

Hi,

I think the servlet mappipng should be ,

        <servlet-mapping>
            <servlet-name>Faces Servlet</servlet-name>
            <url-pattern>/JSF01</url-pattern>
         </servlet-mapping>

Hope this helps.

Martin H.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org