You can use JSTL c:forEach
to iterate over a Map<String, String>
. Every iteration gives you a Map.Entry
which in turn has getKey()
and getValue()
methods. Assuming that you've put it in the request scope by key messages
, here's an example:
<dl>
<c:forEach items="${messages}" var="entry">
<dt>${entry.key}</dt><dd>${entry.value}</dd>
</c:forEach>
</dl>
By the way, JSP/JSTL is not really comparable to the RoR MVC framework. JSP/JSTL is pretty low-level and offers practically no useful abstractions/facilities out of the box to represent a decent MVC approach. You may want to take a look for JSF 2.0 instead. It's the Java EE provided MVC framework. JSP is just a view technology. JSTL is just a standard flow/function/format taglib. Here's a JSF 2.0 tutorial.