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 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 Details

    • ContextPathGenerator

      public ContextPathGenerator(IModel<String> contextRelativePath)
      Constructor
      Parameters:
      contextRelativePath - context-relative path, eg images/border.jpg
    • ContextPathGenerator

      public ContextPathGenerator(String contextRelativePath)
      Constructor
      Parameters:
      contextRelativePath - context-relative path, eg images/border.jpg
  • Method Details

    • 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 class Behavior
      Parameters:
      component - the component that renders this tag currently
      tag - the tag that is rendered
    • detach

      public void detach(Component component)
      Allows the behavior to detach any state it has attached during request processing.
      Overrides:
      detach in class Behavior
      Parameters:
      component - the component that initiates the detachment of this behavior