You might be tempted to configure the XWiki's web.xml file by adding the following mapping:

 <servlet-mapping>
   <servlet-name>action</servlet-name>
   <url-pattern>/*</url-pattern>
 </servlet-mapping>

However this won't work for 2 reasons:

  • The /skins and /resources paths would be matched and thus would go to the Struts Servlet which is not correct (they need to be served as static resources). By default we don't have any mapping for those paths in the web.xml which means the Servlet container will server them statically using the default Servlet. Some containers allows to configure the mapping to point to this default Servlet (On Tomcat, the default Servlet does not accept a parameter for changing the resource base, so you would need to write another default servlet...). On Jetty you could write:
    • For Jetty <= 6.x:
       <servlet>
         <servlet-name>defaultSkins</servlet-name>
         <servlet-class>org.mortbay.jetty.servlet.DefaultServlet</servlet-class>
         <load-on-startup>1</load-on-startup>
       </servlet>
       <servlet-mapping>
         <servlet-name>defaultSkins</servlet-name>
         <url-pattern>/skins/*</url-pattern>
       </servlet-mapping>
       <servlet-mapping>
         <servlet-name>defaultSkins</servlet-name>
         <url-pattern>/resources/*</url-pattern>
       </servlet-mapping>
    • For Jetty >= 7.x:
       <servlet>
         <servlet-name>defaultSkins</servlet-name>
         <servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class>
         <load-on-startup>1</load-on-startup>
       </servlet>
       <servlet-mapping>
         <servlet-name>defaultSkins</servlet-name>
         <url-pattern>/skins/*</url-pattern>
       </servlet-mapping>
       <servlet-mapping>
         <servlet-name>defaultSkins</servlet-name>
         <url-pattern>/resources/*</url-pattern>
       </servlet-mapping>
Tags:
Created by Ecaterina Moraru (Valica) on 2017/09/06
   

Get Connected