Class Include

  • All Implemented Interfaces:
    Serializable, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IGenericComponent<String,​Include>, IMetadataContext<Serializable,​Component>, IHeaderContributor, IRequestableComponent, IHierarchical<Component>, IClusterable

    public class Include
    extends WebComponent
    implements IGenericComponent<String,​Include>

    Component that includes/ renders the import result of an URL, much like JSP include.

    Use this to integrate non-Wicket locations in your page. This component is NOT meant for integrating more Wicket sources as a means of quick and dirty page composition. Use Panels, Borders and (Markup)inheritance for page composition instead.

    You can feed this component the URL directly, or use a model that should deliver a valid URL. You can both use absolute (e.g. and relative (e.g. mydir/mypage.html) urls. This component will try to resolve relative urls to resources in the same webapplication.

    The following example shows how to integrate a header and footer, coming from a plain HTML source on the same server is integrated using this component. The files footer.html and header.html would be located in the web application root directory


            add(new Include("header", "header.html"));
            add(new Include("footer", "footer.html"));
             <div wicket:id="header">header comes here</div>
             <div>I am the body!</div>
             <div wicket:id="footer">footer comes here</div>

    Eelco Hillenius
    See Also:
    Serialized Form
    • Constructor Detail

      • Include

        public Include​(String id)
        id - component id
      • Include

        public Include​(String id,
                       String modelObject)
        id - component id
        modelObject - the model object (will be wrapped in a model)