- All Implemented Interfaces:
Serializable
,IEventSink
,IEventSource
,IFeedbackContributor
,IConverterLocator
,IGenericComponent<String,
,Include> IMetadataContext<Serializable,
,Component> IHeaderContributor
,IRequestableComponent
,IHierarchical<Component>
,IClusterable
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:
-
Field Summary
Fields inherited from class org.apache.wicket.Component
ENABLE, FLAG_INITIALIZED, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER, RFLAG_CONTAINER_DEQUEING, RFLAG_CONTAINER_HAS_REMOVALS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
Imports the contents of the url of the model object.void
onComponentTagBody
(MarkupStream markupStream, ComponentTag openTag) Processes the body.Methods inherited from class org.apache.wicket.markup.html.WebComponent
getWebApplication, getWebPage, getWebRequest, getWebResponse, getWebSession, onRender
Methods inherited from class org.apache.wicket.Component
add, addStateChange, beforeRender, canCallListener, canCallListenerAfterExpiry, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, clearOriginalDestination, configure, continueToOriginalDestination, createConverter, debug, detach, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findMarkupStream, findPage, findParent, findParentWithAssociatedMarkup, get, getAjaxRegionMarkupId, getApplication, getBehaviorById, getBehaviorId, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessages, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkup, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdFromMarkup, getMarkupIdImpl, getMarkupSourcingStrategy, getMarkupTag, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getRequestFlag, getResponse, getSession, getSizeInBytes, getStatelessHint, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalInitialize, internalOnModelChanged, internalRenderComponent, internalRenderHead, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isInitialized, isRenderAllowed, isRendering, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, newMarkupSourcingStrategy, onAfterRender, onBeforeRender, onComponentTag, onConfigure, onDetach, onEvent, onInitialize, onModelChanged, onModelChanging, onReAdd, onRemove, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderPart, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModel, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, toString, toString, urlFor, urlFor, urlFor, urlForListener, urlForListener, visitParents, visitParents, warn, wrap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.wicket.IGenericComponent
getDefaultModel, getDefaultModelObject, getModel, getModelObject, setDefaultModel, setDefaultModelObject, setModel, setModelObject
-
Constructor Details
-
Include
Construct.- Parameters:
id
- component id
-
Include
Construct.- Parameters:
id
- component idmodel
- the model
-
Include
Construct.- Parameters:
id
- component idmodelObject
- the model object (will be wrapped in a model)
-
-
Method Details
-
importAsString
Imports the contents of the url of the model object.- Returns:
- the imported contents
-
onComponentTagBody
Description copied from class:Component
Processes the body.- Overrides:
onComponentTagBody
in classComponent
- Parameters:
markupStream
- The markup streamopenTag
- The open tag for the body
-
getCharset
- Returns:
- The charset of the text to be retrieved and included
-