Class ContextPathGenerator
- java.lang.Object
-
- org.apache.wicket.behavior.Behavior
-
- org.apache.wicket.markup.html.image.ContextPathGenerator
-
- All Implemented Interfaces:
Serializable
,IComponentAwareEventSink
,IComponentAwareHeaderContributor
,IClusterable
public class ContextPathGenerator extends Behavior
A behavior that converts the provider url fragment to a context-relative url. For example if the current url ishttp://localhost/context/product/1231
and the specified url isimages/border.jpg
the generated url will be../../images/border.jpg
- Author:
- Igor Vaynberg (ivaynberg)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ContextPathGenerator(String contextRelativePath)
ConstructorContextPathGenerator(IModel<String> contextRelativePath)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
detach(Component component)
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 Detail
-
ContextPathGenerator
public ContextPathGenerator(IModel<String> contextRelativePath)
Constructor- Parameters:
contextRelativePath
- context-relative path, egimages/border.jpg
-
ContextPathGenerator
public ContextPathGenerator(String contextRelativePath)
Constructor- Parameters:
contextRelativePath
- context-relative path, egimages/border.jpg
-
-
Method Detail
-
onComponentTag
public void onComponentTag(Component component, ComponentTag tag)
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
-
-