Take the 2-minute tour ×

Wicket automatically generates URLs to resources (images etc.) with the prefix "resources" (e.g. "http://localhost:8080/resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js"). Is it possible to change this prefix from "resources" to something else (like "res")?

I have another servlet providing stuff under "resources" and I cannot change it (don't ask...), hence I would like Wicket to serve its resources with a different prefix.


share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

This is not possible in Wicket 1.4, since the path is defined as the constant org.apache.wicket.protocol.http.request.WebRequestCodingStrategy.RESOURCES_PATH_PREFIX and is used hardcoded in the Wicket filter.

In Wicket 1.5 it seems you have to override org.apache.wicket.Application.getEncoderContext() with an IMapperContext which returns your new prefix in getResourceIdentifier().

share|improve this answer
In Wicket 6 this has become newMapperContext –  Stijn Geukens May 17 '13 at 13:19
add comment

Your Answer


