Class ContextImage

All Implemented Interfaces:
Serializable, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IMetadataContext<Serializable,Component>, IHeaderContributor, IRequestableComponent, IHierarchical<Component>, IClusterable

public class ContextImage extends WebComponent
Provides a context-relative image.

Provide a String in this component's model which will be prefixed such that the image is relative to the context root, no matter what URL the page the ContextImage is on is rendered at.

Author:
Alastair Maw, Igor Vaynberg (ivaynberg)
See Also:
  • Constructor Details

    • ContextImage

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

      public ContextImage(String id, String contextRelativePath)
      Constructor
      Parameters:
      id - the component id
      contextRelativePath - context-relative path eg images/border.jpg
    • ContextImage

      public ContextImage(String id)
      Constructor. Uses the url from the src markup attribute and makes it relative to the context path
      Parameters:
      id - the component id
  • Method Details