At 12:06 PM +0000 3/23/04, Pedro Salgado wrote:
<html:messages id="error">

...

</html:messages>

  Does anyone know how do I fill the ${???} to have a JSTL equivalent for
the previous html tag?

<c:forEach items='${???}' var='error'>

...

</c:forEach>

The keys are defined in org.apache.struts.Globals:



org.apache.struts.Globals.ERROR_KEY = "org.apache.struts.action.ERROR"
org.apache.struts.Globals. MESSAGE_KEY = "org.apache.struts.action.ACTION_MESSAGE"



Until recently, the messages were always stored in request scope, so


${requestScope['org.apache.struts.action.ERROR']}

In recent nightly builds, the ability to store the messages in the session instead was added.

I'm not sure I believe that this is a case where using the JSTL is better than using the Struts tags. It seems to me that leaving the coordination inside Struts classes is the way to go. Also, there is no JSTL solution as clean as using the "property" attribute of html:messages to filter to only include messages associated with a specific property.

I'm all for people using the JSTL wherever its better, but I'm not sure its better here...

Joe

--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Imagine if every Thursday your shoes exploded if you tied them the usual way. This happens to us all the time with computers, and nobody thinks of complaining."
-- Jef Raskin


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to