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. http://www.theserverside.com/) 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

Java:

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

Author:
Eelco Hillenius
See Also:
  • Constructor Details

    • Include

      public Include(String id)
      Construct.
      Parameters:
      id - component id
    • Include

      public Include(String id, IModel<String> model)
      Construct.
      Parameters:
      id - component id
      model - the model
    • Include

      public Include(String id, String modelObject)
      Construct.
      Parameters:
      id - component id
      modelObject - the model object (will be wrapped in a model)
  • Method Details