Skip to content

Commit

Permalink
keep dynamic attributes order
Browse files Browse the repository at this point in the history
  • Loading branch information
yasserzamani committed Jan 19, 2022
1 parent 4e05233 commit 8a46e93
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions core/src/main/java/org/apache/struts2/components/UIBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.Writer;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -504,7 +503,7 @@ public UIBean(ValueStack stack, HttpServletRequest request, HttpServletResponse
protected String tooltipIconPath;

// dynamic attributes
protected Map<String, Object> dynamicAttributes = new HashMap<>();
protected Map<String, Object> dynamicAttributes = new LinkedHashMap<>();

protected String defaultTemplateDir;
protected String defaultUITheme;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.DynamicAttributes;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

/**
Expand Down Expand Up @@ -79,7 +79,7 @@ public abstract class AbstractUITag extends ComponentTagSupport implements Dynam
protected String tooltipIconPath;

// dynamic attributes.
protected Map<String, String> dynamicAttributes = new HashMap<>();
protected Map<String, String> dynamicAttributes = new LinkedHashMap<>();

protected void populateParams() {
super.populateParams();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<tr>
<td class="tdLabel"><label for="myname" class="label">mylabel:</label></td>
<td class="tdInput"><input type="text" name="myname" size="10" value="%{1+1}" id="myname" secondAttr="second_%{1+1}" anotherAttr="%{1+1}"/></td>
<td class="tdInput"><input type="text" name="myname" size="10" value="%{1+1}" id="myname" anotherAttr="%{1+1}" secondAttr="second_%{1+1}"/></td>
</tr>

0 comments on commit 8a46e93

Please sign in to comment.