[ http://issues.apache.org/struts/browse/STR-1728?page=all
]
Paul Benedict updated STR-1728:
-------------------------------
Bugzilla Id: (was: 22912)
Component/s: Core
Taglibs
(was: Unknown)
Assignee: (was: Struts Developers)
> ActionMessages.getSortedProperties() needed
> -------------------------------------------
>
> Key: STR-1728
> URL: http:
//issues.apache.org/struts/browse/STR-1728
> Project: Struts 1
> Issue Type: Improvement
> Components: Core, Taglibs
> Affects Versions: 1.1 Final
> Environment: Operating System: other
> Platform: Other
> Reporter: Quande Ren
> Priority: Minor
>
> The <html:errors/> tag will output the standard
error information, the error
> order is defined by the order of properties in the
validation.xml.
> However, the <html:errors/> is not smart enough.
I want to have my own error
> output tag like <mytag:errors/>. I still want to
keep the same order for the
> properties. but the ActionMessages.properties()
returns unsorted properties.
> there's no way to get the sorted properties.
> I suggest that we add another method called
ActionMessages.getSortedProperties
> (), the code can be like this:
> public Iterator getSortedProperties()
> {
> if(this.messages.isEmpty())
> return Collections.EMPTY_LIST.iterator();
> ArrayList keys = new ArrayList();
> for(Iterator i =
this.messages.keySet().iterator(); i.hasNext(); ){
> keys.add(i.next());
> }
> Collections.sort(keys,new Comparator() {
> public int compare(Object o1, Object o2) {
> ActionMessageItem
v1=(ActionMessageItem)messages.get(o1);
> ActionMessageItem
v2=(ActionMessageItem)messages.get(o2);
> return v1.getOrder()-v2.getOrder();
> }
> });
> return keys.iterator();
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the
administrators: http://issues.apache.org/struts/secure/Administrators.
jspa
-
For more information on JIRA, see: http://www.atl
assian.com/software/jira
|