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_AFTER_RENDERING, FLAG_INITIALIZED, FLAG_PREPARED_FOR_RENDER, FLAG_REMOVING_FROM_HIERARCHY, FLAG_RENDERING, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER, RFLAG_CONTAINER_DEQUEING| 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, setBodygetWebApplication, getWebPage, getWebRequest, getWebResponse, getWebSessionadd, addDequeuedComponent, addOrReplace, autoAdd, canDequeueTag, contains, dequeue, dequeue, dequeuePreamble, findChildComponent, findComponentToDequeue, get, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, getRegionMarkup, internalAdd, internalInitialize, iterator, iterator, newDequeueContext, onAfterRenderChildren, onInitialize, onRender, queue, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, swap, toString, toString, visitChildren, visitChildren, visitChildren, visitChildrenadd, addStateChange, afterRender, beforeRender, canCallListenerInterface, canCallListenerInterfaceAfterExpiry, 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, internalPrepareForRender, internalRenderComponent, internalRenderHead, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isRenderAllowed, isRendering, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, newMarkupSourcingStrategy, onAfterRender, onBeforeRender, onConfigure, onEvent, onModelChanged, onModelChanging, onReAdd, onRemove, prepareForRender, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderHead, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setRequestFlag, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, visitParents, warn, wrappublic 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 Componenttag - Tag to modifyComponent.onComponentTag(org.apache.wicket.markup.ComponentTag)public boolean isContextRelative()
public ExternalLink setContextRelative(boolean contextRelative)
contextRelative - Copyright © 2006–2021 Apache Software Foundation. All rights reserved.