Module org.apache.wicket.core
Class ContextPathGenerator
java.lang.Object
org.apache.wicket.behavior.Behavior
org.apache.wicket.markup.html.image.ContextPathGenerator
- All Implemented Interfaces:
Serializable
,IComponentAwareEventSink
,IComponentAwareHeaderContributor
,IClusterable
A behavior that converts the provider url fragment to a context-relative url. For example if the
current url is
http://localhost/context/product/1231
and the specified url is
images/border.jpg
the generated url will be ../../images/border.jpg
- Author:
- Igor Vaynberg (ivaynberg)
- See Also:
-
Constructor Summary
ConstructorDescriptionContextPathGenerator
(String contextRelativePath) ConstructorContextPathGenerator
(IModel<String> contextRelativePath) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
Allows the behavior to detach any state it has attached during request processing.void
onComponentTag
(Component component, ComponentTag tag) Called any time a component that has this behavior registered is rendering the component tag.Methods inherited from class org.apache.wicket.behavior.Behavior
afterRender, beforeRender, bind, canCallListener, getStatelessHint, isEnabled, isTemporary, onAttribute, onConfigure, onEvent, onException, onRemove, onTag, renderHead, unbind
-
Constructor Details
-
ContextPathGenerator
Constructor- Parameters:
contextRelativePath
- context-relative path, egimages/border.jpg
-
ContextPathGenerator
Constructor- Parameters:
contextRelativePath
- context-relative path, egimages/border.jpg
-
-
Method Details
-
onComponentTag
Called any time a component that has this behavior registered is rendering the component tag.- Overrides:
onComponentTag
in classBehavior
- Parameters:
component
- the component that renders this tag currentlytag
- the tag that is rendered
-
detach
Allows the behavior to detach any state it has attached during request processing.
-