Last modified by Ecaterina Moraru (Valica) on 2017/09/06

Show last authors
1 You might be tempted to configure the XWiki's ##web.xml## file by adding the following mapping:
2
3 {{code language="xml"}}
4 <servlet-mapping>
5 <servlet-name>action</servlet-name>
6 <url-pattern>/*</url-pattern>
7 </servlet-mapping>
8 {{/code}}
9
10 However this won't work for 2 reasons:
11 * 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:
12 ** For Jetty <= 6.x:(((
13 {{code language="xml"}}
14 <servlet>
15 <servlet-name>defaultSkins</servlet-name>
16 <servlet-class>org.mortbay.jetty.servlet.DefaultServlet</servlet-class>
17 <load-on-startup>1</load-on-startup>
18 </servlet>
19 <servlet-mapping>
20 <servlet-name>defaultSkins</servlet-name>
21 <url-pattern>/skins/*</url-pattern>
22 </servlet-mapping>
23 <servlet-mapping>
24 <servlet-name>defaultSkins</servlet-name>
25 <url-pattern>/resources/*</url-pattern>
26 </servlet-mapping>
27 {{/code}}
28 )))
29 ** For Jetty >= 7.x:(((
30 {{code language="xml"}}
31 <servlet>
32 <servlet-name>defaultSkins</servlet-name>
33 <servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class>
34 <load-on-startup>1</load-on-startup>
35 </servlet>
36 <servlet-mapping>
37 <servlet-name>defaultSkins</servlet-name>
38 <url-pattern>/skins/*</url-pattern>
39 </servlet-mapping>
40 <servlet-mapping>
41 <servlet-name>defaultSkins</servlet-name>
42 <url-pattern>/resources/*</url-pattern>
43 </servlet-mapping>
44 {{/code}}

Get Connected