I am iterating over a Collection in a JSP using JSTL in such a way that to display the code and description for each member of the collection, I write this:
But I'm trying to avoid that...
By the way, we're using Struts, but in this particular case, we retrieve the Collection of results from the Hibernate end and pass it all the way up to the Action class where it's placed in the request--the results aren't stored in a Struts form class, so it seems like the best place to escape the data would be here in the JSP. [ November 16, 2005: Message edited by: Stephen Huey ]
I just added a JSP FAQ entry on defining EL functions that uses this very question as an example. Thanks for the inspiration.
Thank yo'all for the mighty fine tip, boys! Much obliged!
Bonus: I can now have a EL function named escXml instead of the long-winded JSTL fn function escapeXml .