Hi all,
I'm trying to serve some css files from a custom dir outside the web dir.
It should get a little more complicated that I'd want to fallback to serve
the file from a package location if it's not found in the custom-css folder,
but let's keep it simple first.
I've created a class
public class CustomCssResource extends AbstractResource implements
IStaticCacheableResource {
public CustomCssResource(String path) {
this.path = path;
}
...
}
that returns the css file found at path location.
And public class CustomCssResourceReference extends ResourceReference {
public CustomCssResourceReference(String name) {
super(scope, "custom-css-dir/" + name);
}
public IResource getResource() {
return new CustomCssResource(name);
}
}
In pages I do something like this:
response.renderCSSReference(new CustomCssResourceReference("front.css"));
Problem is that I'd want to mount this serving of resources from
"/customcss"
But how should this be done? Because I cannot just do
app.mountResource("/customcss", new CustomCssResourceReference("???"));
Should I bind as SharedResources all css files instead of using
CustomCssResourceReference?
Thanks.
-----
http://balamaci.wordpress.com
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Overridable-css-resource-tp4229370p4229370.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]