mirror of
https://github.com/apache/struts.git
synced 2026-08-11 01:27:14 +00:00
WW-5357 Adds support for disabled attribute to anchor tag
This commit is contained in:
@@ -25,6 +25,9 @@
|
||||
<#if parameters.href??>
|
||||
href="${parameters.href?no_esc}"<#rt/>
|
||||
</#if>
|
||||
<#if parameters.disabled!false>
|
||||
disabled="disabled"<#rt/>
|
||||
</#if>
|
||||
<#if parameters.tabindex??>
|
||||
tabindex="${parameters.tabindex}"<#rt/>
|
||||
</#if>
|
||||
|
||||
@@ -276,6 +276,23 @@ public class AnchorTest extends AbstractUITagTest {
|
||||
verifyResource("href-5.txt");
|
||||
}
|
||||
|
||||
public void testSimpleDisabled() throws Exception {
|
||||
createAction();
|
||||
|
||||
AnchorTag tag = createTag();
|
||||
tag.setHref("a");
|
||||
tag.setDisabled("true");
|
||||
|
||||
StrutsBodyContent body = new StrutsBodyContent(null);
|
||||
body.print("should have disabled attribute");
|
||||
tag.setBodyContent(body);
|
||||
|
||||
tag.doStartTag();
|
||||
tag.doEndTag();
|
||||
|
||||
verifyResource("href-6.txt");
|
||||
}
|
||||
|
||||
public void testInjectEscapeHtmlBodyFlag() throws Exception {
|
||||
// given
|
||||
initDispatcherWithConfigs("struts-default.xml, struts-escape-body.xml");
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<a id="mylink" href="a" disabled="disabled">should have disabled attribute</a>
|
||||
Reference in New Issue
Block a user