Class MetaInfStaticResourceReference
- java.lang.Object
-
- org.apache.wicket.request.resource.ResourceReference
-
- org.apache.wicket.request.resource.PackageResourceReference
-
- org.apache.wicket.request.resource.MetaInfStaticResourceReference
-
- All Implemented Interfaces:
Serializable
,IClusterable
public class MetaInfStaticResourceReference extends PackageResourceReference
Resource reference for static files. The resource must reside under the "/META-INF/resources/" directory. So if you have a foo.bar.Component and want to have a static icon.gif belonging to it the image must be available on the "META-INF/resources/foo/bar/icon.gif" classpath inside a jar file. If run under a Servlet 3.0 environment "foo/bar/icon.gif" like resource urls will be made and served by the servlet container instead of wicket (which is faster). If run under a non Servlet 3.0 environment (like 2.5) resources will be served by wicket (urls will look like "wicket/resource/foo/bar/icon.gif").- Author:
- akiraly
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.wicket.request.resource.ResourceReference
ResourceReference.Key, ResourceReference.LambdaResourceReference, ResourceReference.UrlAttributes
-
-
Constructor Summary
Constructors Constructor Description MetaInfStaticResourceReference(Class<?> scope, String name)
Construct.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
isMetaInfResourcesSupported()
Url
mapHandler(IRequestHandler requestHandler)
Returns theUrl
for givenIRequestHandler
if "/META-INF/resources" Servlet 3.0 feature is supported ornull
if not (so standard url mapping can take place).-
Methods inherited from class org.apache.wicket.request.resource.PackageResourceReference
getMinifiedName, getResource, getUrlAttributes, readBuffered, removeCompressFlagIfUnnecessary
-
Methods inherited from class org.apache.wicket.request.resource.ResourceReference
canBeRegistered, equals, getDependencies, getExtension, getKey, getLocale, getName, getScope, getStyle, getVariation, hashCode, of, of, toString
-
-
-
-
Constructor Detail
-
MetaInfStaticResourceReference
public MetaInfStaticResourceReference(Class<?> scope, String name)
Construct.- Parameters:
scope
- mandatory parametername
- mandatory parameter
-
-
Method Detail
-
mapHandler
public Url mapHandler(IRequestHandler requestHandler)
Returns theUrl
for givenIRequestHandler
if "/META-INF/resources" Servlet 3.0 feature is supported ornull
if not (so standard url mapping can take place).- Parameters:
requestHandler
- mandatory parameter- Returns:
- Url instance or
null
.
-
isMetaInfResourcesSupported
protected boolean isMetaInfResourcesSupported()
-
-