public class Anchor extends ClosingUIBean
A tag that creates a HTML <a >.This tag supports the same attributes as the "url" tag, including nested parameters using the "param" tag.
Examples
<s:a id="link1" href="/do-it.action"> <img border="none" src="<%=request.getContextPath()%>/images/delete.gif"/> <s:param name="id" value="1"/> </s:a>
Modifier and Type | Field and Description |
---|---|
static String |
COMPONENT_NAME |
protected boolean |
escapeHtmlBody |
protected String |
href |
static String |
OPEN_TEMPLATE |
protected boolean |
processingTagBody |
static String |
TEMPLATE |
protected Map |
urlParameters |
protected UrlProvider |
urlProvider |
protected UrlRenderer |
urlRenderer |
accesskey, cssClass, cssErrorClass, cssErrorStyle, cssStyle, defaultTemplateDir, defaultUITheme, disabled, dynamicAttributes, errorPosition, id, javascriptTooltip, key, label, labelPosition, labelSeparator, name, onblur, onchange, onclick, ondblclick, onfocus, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onselect, request, requiredLabel, requiredPosition, response, tabindex, template, templateDir, templateEngineManager, templateSuffix, theme, title, tooltip, tooltipConfig, tooltipCssClass, tooltipDelay, tooltipIconPath, uiThemeExpansionToken, value
actionMapper, COMPONENT_STACK, devMode, parameters, stack, standardAttributesMap, throwExceptionOnELFailure
Constructor and Description |
---|
Anchor(ValueStack stack,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
Modifier and Type | Method and Description |
---|---|
void |
addAllParameters(Map params)
Adds all the given parameters to this component's own parameters.
|
void |
addParameter(String key,
Object value)
Adds the given key and value to this component's own parameter.
|
boolean |
end(Writer writer,
String body)
Overrides to be able to render body in a template rather than always before the template
|
boolean |
escapeHtmlBody()
Override to set if body content should be HTML-escaped.
|
protected void |
evaluateExtraParams() |
String |
getDefaultOpenTemplate() |
protected String |
getDefaultTemplate()
A contract that requires each concrete UI Tag to specify which template should be used as a default.
|
UrlProvider |
getUrlProvider() |
void |
setAction(String action) |
void |
setAnchor(String anchor) |
void |
setEncode(boolean encode) |
void |
setEscapeAmp(boolean escapeAmp) |
void |
setEscapeHtmlBody(boolean escapeHtmlBody) |
void |
setExtraParameterProvider(ExtraParameterProvider provider) |
void |
setForceAddSchemeHostAndPort(boolean forceAddSchemeHostAndPort) |
void |
setHref(String href) |
void |
setIncludeContext(boolean includeContext) |
void |
setIncludeParams(String includeParams) |
void |
setMethod(String method) |
void |
setNamespace(String namespace) |
void |
setPortletMode(String portletMode) |
void |
setPortletUrlType(String portletUrlType) |
void |
setScheme(String scheme) |
void |
setUrlIncludeParams(String urlIncludeParams) |
void |
setUrlRenderer(UrlRenderer urlRenderer) |
void |
setValue(String value) |
void |
setWindowState(String windowState) |
boolean |
start(Writer writer)
Callback for the start tag of this component.
|
boolean |
usesBody()
Overwrite to set if body should be used.
|
setOpenTemplate
addFormParameter, buildTemplateName, copyParams, enableAncestorFormCustomOnsubmit, ensureAttributeSafelyNotEscaped, escape, evaluateNameValue, evaluateParams, getId, getTemplate, getTemplateDir, getTheme, getTooltipConfig, getValueClassType, mergeTemplate, populateComponentHtmlId, setAccesskey, setClass, setCssClass, setCssErrorClass, setCssErrorStyle, setCssStyle, setDefaultTemplateDir, setDefaultUITheme, setDisabled, setDynamicAttributes, setErrorPosition, setId, setJavascriptTooltip, setKey, setLabel, setLabelposition, setLabelSeparator, setName, setOnblur, setOnchange, setOnclick, setOndblclick, setOnfocus, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnselect, setRequiredLabel, setRequiredPosition, setStyle, setTabindex, setTemplate, setTemplateDir, setTemplateEngineManager, setTheme, setTitle, setTooltip, setTooltipConfig, setTooltipCssClass, setTooltipDelay, setTooltipIconPath, setUIThemeExpansionToken
altSyntax, completeExpressionIfAltSyntax, determineActionURL, determineNamespace, end, fieldError, findAncestor, findString, findString, findStringIfAltSyntax, findValue, findValue, findValue, getComponentStack, getParameters, getStack, getStandardAttributes, isValidTagAttribute, popComponentStack, setActionMapper, setDevMode, setThrowExceptionsOnELFailure, setUrlHelper, stripExpressionIfAltSyntax, toString
public static final String OPEN_TEMPLATE
public static final String TEMPLATE
public static final String COMPONENT_NAME
protected String href
protected UrlProvider urlProvider
protected UrlRenderer urlRenderer
protected boolean processingTagBody
protected boolean escapeHtmlBody
protected Map urlParameters
public Anchor(ValueStack stack, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
public String getDefaultOpenTemplate()
getDefaultOpenTemplate
in class ClosingUIBean
protected String getDefaultTemplate()
UIBean
getDefaultTemplate
in class UIBean
public boolean usesBody()
Component
public boolean escapeHtmlBody()
escapeHtmlBody
in class Component
protected void evaluateExtraParams()
evaluateExtraParams
in class UIBean
public void setUrlIncludeParams(String urlIncludeParams)
public void setUrlRenderer(UrlRenderer urlRenderer)
public void setExtraParameterProvider(ExtraParameterProvider provider)
public boolean start(Writer writer)
Component
start
in class ClosingUIBean
writer
- the output writer.public boolean end(Writer writer, String body)
public void addParameter(String key, Object value)
Component
addParameter
in class Component
key
- the key of the new parameter to add.value
- the value associated with the key.public void addAllParameters(Map params)
Component
addAllParameters
in class Component
params
- the parameters to add.public UrlProvider getUrlProvider()
public void setHref(String href)
public void setIncludeParams(String includeParams)
public void setScheme(String scheme)
public void setAction(String action)
public void setNamespace(String namespace)
public void setMethod(String method)
public void setEncode(boolean encode)
public void setIncludeContext(boolean includeContext)
public void setPortletMode(String portletMode)
public void setWindowState(String windowState)
public void setPortletUrlType(String portletUrlType)
public void setAnchor(String anchor)
public void setEscapeAmp(boolean escapeAmp)
public void setForceAddSchemeHostAndPort(boolean forceAddSchemeHostAndPort)
public void setEscapeHtmlBody(boolean escapeHtmlBody)
Copyright © 2000–2020 Apache Software Foundation. All rights reserved.