You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Vinodhini (JIRA)" <ji...@apache.org> on 2006/12/29 09:45:57 UTC
[jira] Commented: (STR-910) To "errors", add prefix, suffix,
header, footer attrs, to "messages", add prefix, suffix attrs
[ http://issues.apache.org/struts/browse/STR-910?page=comments#action_39193 ]
Vinodhini commented on STR-910:
-------------------------------
I would like to propose a new idea. It is good to see that html:messages will not have markup code in application resources. So, it is better if the attributes, header and footer of html:messages tag is removed. Otherwise, it shows no meaning at all.
There is one more issue. And I am explaining as a example:
Consider for eg, I have 5 fields. For the first 2 fields, the errors will be displayed by mentioning their property in the html:error tag. And I want to display the remaining errors at the end of the page. So, for this I use <html:errors/>. But I don't want to display all 5 error messages. Only the remaining 3 messages whose property haven't highlighted the the tag, has to be displayed at the end of the page. How should I do that ? Please help.
> To "errors", add prefix, suffix, header, footer attrs, to "messages", add prefix, suffix attrs
> ----------------------------------------------------------------------------------------------
>
> Key: STR-910
> URL: http://issues.apache.org/struts/browse/STR-910
> Project: Struts 1
> Issue Type: Improvement
> Components: Taglibs
> Affects Versions: Nightly Build
> Environment: Operating System: other
> Platform: Other
> Reporter: David M. Karr
> Assigned To: Struts Developers
> Priority: Minor
> Fix For: 1.2 Family
>
>
> It appears to me that the "html:messages" tag is somewhat handicapped, in
> comparison to the "html:errors" tag. The "html:errors" tag can use a
> "prefix" and "suffix" for each error. There appears to be nothing like this
> for the "html:messages" tag. There is a "header" and "footer" for both
> tags, which is printed before and after the LIST of errors or messages, but
> nothing to put around each message.
> It's also curious that the way the "header" and "footer" are defined in
> these tags is different. The "html:errors" tag has a hardcoded resource
> name to retrieve the header and footer (and prefix and suffix), but the
> "html:messages" tag has "header" and "footer" attributes to specify a key to
> use. I like using the attribute value to specify this, or at least override
> it.
> I propose the following changes:
> Change the "html:messages" tag, adding two new attributes, named "prefix" and
> "suffix", which specify the message keys for a prefix and suffix on each
> message. These are very similar to the existing "header" and "footer"
> attributes, but I also propose the following changes to how those two attributes
> are used, in addition to the two new ones: If the attribute is unset, it will
> use a default of "messages.header", etcetera.
> Note there is one subtle backwards compatibility issue with this change: If a
> user had an existing property named "messages.header", "messages.footer",
> "messages.prefix", or "messages.suffix", and they had a "html:messages" element
> without any of the attributes "header", "footer", "prefix" or "suffix", then the
> behavior of their "html:messages" tag would change, in a likely unintended way:
> it would now use the value of "messages.header" (and others).
> On the "html:errors" tag, I would make it work consistently, adding four new
> attributes, of the obvious names, which will use defaults if unset, being the
> existing values of "errors.header", etcetera. The change to this tag has no
> backwards compatibility issue, because if the attributes were unset, it was
> always defined to use the existing "errors.header" resources.
> Adding this functionality to the "html:errors" tag would give developers the
> ability to have more than one pattern for displaying errors in their
> application. Presently, they can only define the "errors.header" resources
> once, so all displays of "html:errors" will use the same patterns.
--
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.atlassian.com/software/jira