Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

order of <servlet mapping> in web.xml

843844Aug 7 2007 — edited Aug 7 2007
Hello,
is the order of multiple <servlet-mapping> in web.xml important? Or it doesn't matter in which order they are declared?

For example, if i have two controllers, one is
 <servlet-name>Faces Servlet</servlet-name>
  <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
  <load-on-startup>1</load-on-startup>
 </servlet>

and the second:
  <servlet>
    <servlet-name>FrontController</servlet-name>
   
    <servlet-class>servlets.FrontController</servlet-class>
  </servlet>
and the mapping are:

   <servlet-mapping>
    <servlet-name>FrontController</servlet-name>
    <url-pattern>/jsf/*</url-pattern>
  </servlet-mapping>

<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
  </servlet-mapping>
where /jsf/ contains jsp pages containing jsf components.

is the order important?
And may second question is:
if i call the jsp page test.jsf in /jsf/test.jsp , which controller is responseble? Faces servlet or Frontcontroller?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 4 2007
Added on Aug 7 2007
4 comments
1,579 views