Carlos Pita wrote:
>
> 5) The errors tag should be more capable of controlling the presentation
> of its output. I think it's a very dirty solution to write html in the
> application resources file. The examples someway hide this, showing property
> values like: "<li>Invalid format for From Address</li>", but real
> applications would have an important percentage of html (or some kind of
> presentational information) embedded in the resources file. This is not
> easily mantenible and internationalization support would be very cumbersome
> to achieve in this scenario (having to update several files and lot of items
> in these files with duplicated information about presentation). I suggest
> that the errors tag should let the programmer to specify some kind of
> formatting content, preferently as the content of the tag and inside
> sections like
> <start-of-item>,<end-of-item>,<start-of-list>,<end-of-list>,<no-errors>,
> etc. (by the way, this would be very useful with any iterator tag; perhaps
> we should have to subclass from some basic iterator tag class, or to have
> some kind of hierarchy here, but I've not seen the current code so I could
> not say any more about this).
You can do this:
(Please correct me if there is a better way)
<logic:present parameter="org.apache.struts.action.ERROR"> (parameter,
even though "org.apache.struts.action.ERROR" is an attribute?)
... all the html you want here
<html:errors/>
... and here
</logic:present>
<logic:notPresent parameter="org.apache.struts.action.ERROR">
Display this otherwise.
</logic:notPresent>
I would like to a write two tags however, that look like the following:
<html:inError>
<html:errors/>
</html:inError>
<html:notInError>
Display this otherwise
</html:notInError>
Any objections to the above suggestion?
Cheers,
Nick
> Well, I think this is all for now. I've thought some solutions for each
> of the enumerated problems, but I would like to hear your oppinion about
> these being real problems before explaining or discussing them.
>
> See you,
> Carlos
>
> Ah... sorry if my English is not the best