public class ExternalLink extends AbstractLink
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).
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 and Description |
---|
ExternalLink(String id,
IModel<String> href)
Constructor.
|
ExternalLink(String id,
IModel<String> href,
IModel<?> label)
Constructor.
|
ExternalLink(String id,
String href)
Constructor.
|
ExternalLink(String id,
String href,
String label)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
PopupSettings |
getPopupSettings()
Gets the popup specification.
|
boolean |
isContextRelative() |
protected void |
onComponentTag(ComponentTag tag)
Processes the component tag.
|
ExternalLink |
setContextRelative(boolean contextRelative)
Set to true if this link should be automatically prepended with ../ to make it relative to
the context root.
|
ExternalLink |
setPopupSettings(PopupSettings popupSettings)
Sets the popup specification.
|
disableLink, getBody, onComponentTagBody, onDetach, setBody
getWebApplication, getWebPage, getWebRequest, getWebResponse, getWebSession
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
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, 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, renderHead, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public ExternalLink(String id, String href, String label)
id
- See Componenthref
- the href attribute to setlabel
- the label (body)public ExternalLink(String id, String href)
id
- The name of this componenthref
- the href attribute to setpublic ExternalLink(String id, IModel<String> href)
id
- The name of this componenthref
- the href attribute to setpublic final PopupSettings getPopupSettings()
public final ExternalLink setPopupSettings(PopupSettings popupSettings)
popupSettings
- the popup specification.protected void onComponentTag(ComponentTag tag)
onComponentTag
in class Component
tag
- Tag to modifyComponent.onComponentTag(org.apache.wicket.markup.ComponentTag)
public boolean isContextRelative()
public ExternalLink setContextRelative(boolean contextRelative)
contextRelative
- Copyright © 2006–2022 Apache Software Foundation. All rights reserved.