I am pretty much a newb myself to all this, but what do you have in your welcome file list. If you have index.jsp, that could be screwing things up maybe? I read in a book that a JSF app usually bootstraps with an index.html that redirects to the first jsf page sort of like

index.html -> home.leg

I have not tried index.leg which many not work for me either. Run a quick test and create a test.jsp page and type in the url http://localhost:8080/test/test.leg and see if that works. If it does, it could have something to do with welcome-file-list.
dean

Legolas Woodland wrote:

Hi Dean,
I have changed my web.xml  file as follow :


<servlet>
       <servlet-name>Faces Servlet</servlet-name>
       <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
       <load-on-startup>1</load-on-startup>
   </servlet>

   <!-- Faces Servlet Mapping -->

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

I have *No* .leg file in my web root file.
i have files like :
index.jsp
logout.jsp
login.jsp

When i tried to access my index.jsp using the following url :
http://127.0.0.1:8080/test/index.leg
it return

*HTTP Status 404 -
*

*what else i should configure to use .leg extension ?
should i change all of myfiles extension to .leg?
*


before this i used the formal /faces/* as a url pattern , on that time i could access my jsp files using
http://localhost:8080/test/faces/index.jsp


Thanks


Dean Hiller wrote:

yes, I use *.jsf. when a url http://localhost:8080/webapp/page.jsf is called, it calls the jsp in webroot of your war file. I also personally put this in my web.xml.....

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

This allows me to name all my JSF jsps xxxx.jspx and I can name all my normal jsps(that are not for JSF) xxxxx.jsp. I tried to figure out how I could use jsf in the url and in the file name in the war file, but it seems that cannot be done right now(or I could not figure it out).
later,
dean



Legolas Woodland wrote:

There are two declaration in web.xml that i can not understand
these are :

<servlet>
       <servlet-name>Faces Servlet</servlet-name>
       <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
       <load-on-startup>1</load-on-startup>
   </servlet>

   <!-- Faces Servlet Mapping -->

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


I just can not understand , in some places they set another url-pattern , for example :
       <url-pattern>*.faces</url-pattern>
and thier application works file.

but for me with the first url-mapping , i should navigate to
http://localhost:8080/testApp/faces/index.jsp to works
so my understanding is that :
when i navigate to that url , the pattern matches and filter applies to my request.

but when people uses *.faces in url-pattern , how they navigate to jsp pages ? should they change the file extensions to use jsf pages , or there is some other triks ?


Thank you






Reply via email to