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.
Thanks!
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()
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With