- All Implemented Interfaces:
Serializable
,Iterable<Component>
,IEventSink
,IEventSource
,IFeedbackContributor
,IConverterLocator
,IMetadataContext<Serializable,
,Component> IHeaderContributor
,IRequestableComponent
,IHierarchical<Component>
,IClusterable
A simple anchor link (<a href="http://url">) pointing to any URL. Usually this is used for links to destinations outside of Wicket.
Note: in the case when the support for cookies in the browser is disabled the
user's jsessionid will leak in the 'Referrer' header after clicking this link. If this is a
problem for the application then better use a Link
which redirects to a shared resource
(see
WebApplication.mountResource(String, org.apache.wicket.request.resource.ResourceReference)
, e.g. "/myapp/redirecting-resource?url=...") which on its side redirects to the new URL using
RedirectToUrlException
. Another option is to use rel="noreferrer"
attribute
in your markup but this will work only in the modern browsers (supporting HTML5 standard).
- Author:
- Juergen Donnerstag
- 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
ConstructorDescriptionExternalLink
(String id, String href) Constructor.ExternalLink
(String id, String href, String label) Constructor.ExternalLink
(String id, IModel<String> href) Constructor.ExternalLink
(String id, IModel<String> href, IModel<?> label) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal PopupSettings
Gets the popup specification.boolean
protected void
Processes the component tag.void
renderHead
(IHeaderResponse response) Render to the web response whatever the component wants to contribute to the head section.setContextRelative
(boolean contextRelative) Set to true if this link should be automatically prepended with ../ to make it relative to the context root.final ExternalLink
setPopupSettings
(PopupSettings popupSettings) Sets the popup specification.Methods inherited from class org.apache.wicket.markup.html.link.AbstractLink
disableLink, getBody, onComponentTagBody, onDetach, setBody
Methods inherited from class org.apache.wicket.markup.html.WebMarkupContainer
getWebApplication, getWebPage, getWebRequest, getWebResponse, getWebSession
Methods inherited from class org.apache.wicket.MarkupContainer
add, addDequeuedComponent, addOrReplace, autoAdd, canDequeueTag, contains, dequeue, dequeue, dequeuePreamble, findChildComponent, findComponentToDequeue, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, getRegionMarkup, internalAdd, internalInitialize, iterator, iterator, newDequeueContext, onInitialize, onRender, queue, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, stream, streamChildren, toString, toString, visitChildren, visitChildren
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, 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, internalOnModelChanged, internalRenderComponent, internalRenderHead, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isInitialized, isRenderAllowed, isRendering, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, newMarkupSourcingStrategy, onAfterRender, onBeforeRender, onConfigure, onEvent, onModelChanged, onModelChanging, onReAdd, onRemove, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderPart, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, 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 java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ExternalLink
Constructor.- Parameters:
id
- See Componenthref
- the href attribute to setlabel
- the label (body)
-
ExternalLink
Constructor.- Parameters:
id
- The name of this componenthref
- the href attribute to set
-
ExternalLink
Constructor.- Parameters:
id
- The name of this componenthref
- the href attribute to set
-
ExternalLink
Constructor.- Parameters:
id
- See Componenthref
- the href attribute to setlabel
- the label (body)
-
-
Method Details
-
getPopupSettings
Gets the popup specification. If not-null, a javascript on-click event handler will be generated that opens a new window using the popup properties.- Returns:
- the popup specification.
-
setPopupSettings
Sets the popup specification. If not-null, a javascript on-click event handler will be generated that opens a new window using the popup properties.- Parameters:
popupSettings
- the popup specification.- Returns:
- This
-
onComponentTag
Processes the component tag.- Overrides:
onComponentTag
in classComponent
- Parameters:
tag
- Tag to modify- See Also:
-
renderHead
Description copied from class:Component
Render to the web response whatever the component wants to contribute to the head section.- Specified by:
renderHead
in interfaceIHeaderContributor
- Overrides:
renderHead
in classComponent
- Parameters:
response
- Response object
-
isContextRelative
- Returns:
- True if this link is automatically prepended with ../ to make it relative to the context root.
-
setContextRelative
Set to true if this link should be automatically prepended with ../ to make it relative to the context root.- Parameters:
contextRelative
-- Returns:
- This for chaining
-