Class UrlResourceReference
- java.lang.Object
-
- org.apache.wicket.request.resource.ResourceReference
-
- org.apache.wicket.request.resource.UrlResourceReference
-
- All Implemented Interfaces:
Serializable
,IClusterable
public class UrlResourceReference extends ResourceReference
A ResourceReference that can be used to point to a resource by using an Url. For example to a resource residing in a CDN (Content Delivering Network) or context relative one.- Since:
- 6.0
- 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 UrlResourceReference(Url url)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IResource
getResource()
Returns the resource.Url
getUrl()
boolean
isContextRelative()
UrlResourceReference
setContextRelative(boolean contextRelative)
String
toString()
-
Methods inherited from class org.apache.wicket.request.resource.ResourceReference
canBeRegistered, equals, getDependencies, getExtension, getKey, getLocale, getName, getScope, getStyle, getUrlAttributes, getVariation, hashCode, of, of
-
-
-
-
Constructor Detail
-
UrlResourceReference
public UrlResourceReference(Url url)
Constructor.- Parameters:
url
- the url of the external resource
-
-
Method Detail
-
getResource
public final IResource getResource()
Description copied from class:ResourceReference
Returns the resource.- Specified by:
getResource
in classResourceReference
- Returns:
null
because this ResourceReference won't use an IResource to deliver the content of the external resource. The browser will make a direct request to the external url.
-
setContextRelative
public UrlResourceReference setContextRelative(boolean contextRelative)
-
isContextRelative
public boolean isContextRelative()
-
toString
public String toString()
- Overrides:
toString
in classResourceReference
-
-