struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject [1/3] struts git commit: Allow html5 attributes
Date Thu, 03 Mar 2016 16:41:07 GMT
Repository: struts
Updated Branches:
  refs/heads/master e5d693a8d -> 65e2a864a


Allow html5 attributes

Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/40f7b39c
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/40f7b39c
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/40f7b39c

Branch: refs/heads/master
Commit: 40f7b39c3f1f99de1806a5afb84166090f00d4ce
Parents: 24085bd
Author: gregh3269 <gregh3269@gmail.com>
Authored: Wed Feb 10 08:53:32 2016 +0000
Committer: gregh3269 <gregh3269@gmail.com>
Committed: Wed Feb 10 08:53:32 2016 +0000

----------------------------------------------------------------------
 .../org/apache/struts2/views/java/simple/TextFieldHandler.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/40f7b39c/plugins/javatemplates/src/main/java/org/apache/struts2/views/java/simple/TextFieldHandler.java
----------------------------------------------------------------------
diff --git a/plugins/javatemplates/src/main/java/org/apache/struts2/views/java/simple/TextFieldHandler.java
b/plugins/javatemplates/src/main/java/org/apache/struts2/views/java/simple/TextFieldHandler.java
index ba5a689..d79e4d3 100644
--- a/plugins/javatemplates/src/main/java/org/apache/struts2/views/java/simple/TextFieldHandler.java
+++ b/plugins/javatemplates/src/main/java/org/apache/struts2/views/java/simple/TextFieldHandler.java
@@ -31,8 +31,8 @@ public class TextFieldHandler extends AbstractTagHandler implements TagGenerator
     public void generate() throws IOException {
         Map<String, Object> params = context.getParameters();
         Attributes attr = new Attributes();
-
-        attr.add("type", "text")
+        Object type = params.get("type");
+        attr.add("type", type == null ? "text" : (String) type)
                 .addDefaultToEmpty("name", params.get("name"))
                 .addIfExists("size", params.get("size"))
                 .addIfExists("maxlength", params.get("maxlength"))


Mime
View raw message