mirror of
https://github.com/apache/struts.git
synced 2026-08-07 15:46:57 +00:00
WW-4084 Restores appending <s:param>s to <s:a/> tag which was broken since WW-3920
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1487806 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
+13
-17
@@ -28,32 +28,28 @@ import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
public class AnchorHandler extends AbstractTagHandler implements TagGenerator {
|
||||
|
||||
public void generate() throws IOException {
|
||||
Map<String, Object> params = context.getParameters();
|
||||
|
||||
Attributes attrs = new Attributes();
|
||||
attrs.addIfExists("name", params.get("name"))
|
||||
.addIfExists("id", params.get("id"))
|
||||
.addIfExists("class", params.get("cssClass"))
|
||||
.addIfExists("style", params.get("cssStyle"))
|
||||
.addIfExists("href", params.get("href"), false)
|
||||
.addIfExists("title", params.get("title"))
|
||||
.addIfExists("tabindex", params.get("tabindex"));
|
||||
start("a", attrs);
|
||||
//all rendering must happend at the end of the tag, so we can support nested params
|
||||
}
|
||||
|
||||
public static class CloseHandler extends AbstractTagHandler implements TagGenerator {
|
||||
|
||||
public void generate() throws IOException {
|
||||
Map<String, Object> params = context.getParameters();
|
||||
|
||||
Attributes attrs = new Attributes();
|
||||
|
||||
attrs.addIfExists("name", params.get("name"))
|
||||
.addIfExists("id", params.get("id"))
|
||||
.addIfExists("class", params.get("cssClass"))
|
||||
.addIfExists("style", params.get("cssStyle"))
|
||||
.addIfExists("href", params.get("href"), false)
|
||||
.addIfExists("title", params.get("title"))
|
||||
.addIfExists("tabindex", params.get("tabindex"));
|
||||
start("a", attrs);
|
||||
String body = (String) params.get("body");
|
||||
if (StringUtils.isNotEmpty(body)) {
|
||||
if (StringUtils.isNotEmpty(body))
|
||||
characters(body, false);
|
||||
}
|
||||
end("a");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -39,8 +39,8 @@ public class SimpleTheme extends DefaultTheme {
|
||||
put("select", new FactoryList(SelectHandler.class, ScriptingEventsHandler.class, CommonAttributesHandler.class, DynamicAttributesHandler.class));
|
||||
put("form", new FactoryList(FormHandler.class, ScriptingEventsHandler.class, CommonAttributesHandler.class, DynamicAttributesHandler.class));
|
||||
put("form-close", new FactoryList(FormHandler.CloseHandler.class));
|
||||
put("a", new FactoryList(AnchorHandler.class, ScriptingEventsHandler.class, CommonAttributesHandler.class, DynamicAttributesHandler.class));
|
||||
put("a-close", new FactoryList(AnchorHandler.CloseHandler.class));
|
||||
put("a", new FactoryList(AnchorHandler.class));
|
||||
put("a-close", new FactoryList(AnchorHandler.CloseHandler.class, ScriptingEventsHandler.class, CommonAttributesHandler.class, DynamicAttributesHandler.class));
|
||||
put("checkbox", new FactoryList(CheckboxHandler.class, ScriptingEventsHandler.class, CommonAttributesHandler.class, DynamicAttributesHandler.class));
|
||||
put("file", new FactoryList(FileHandler.class, ScriptingEventsHandler.class, CommonAttributesHandler.class, DynamicAttributesHandler.class));
|
||||
put("password", new FactoryList(PasswordHandler.class, ScriptingEventsHandler.class, CommonAttributesHandler.class, DynamicAttributesHandler.class));
|
||||
|
||||
Reference in New Issue
Block a user