Yes, this is perfectly acceptable.
When you use <c:forEach>
to iterate over a Map
, each item in the iteration is an instance of Map.Entry
. So given your example:
<c:forEach var="type" items="${types}">
Key is ${type.key}
Value is ${type.value}
</c:forEach>
More Related Contents:
- How to iterate an ArrayList inside a HashMap using JSTL?
- EL access a map value by Integer key
- How to do if-else in Thymeleaf?
- How to get a index value from foreach loop in jstl
- Access Enum value using EL with JSTL
- IntelliJ and JSP/JSTL cannot resolve taglib for JSTL in tomcat7 [duplicate]
- How to resolve : Can not find the tag library descriptor for “http://java.sun.com/jsp/jstl/core” [duplicate]
- The ultimate Java version table (J2EE, Java EE, Servlet, JSP, JSTL)
- I can pass a variable from a JSP scriptlet to JSTL but not from JSTL to a JSP scriptlet without an error
- Where can I download JSTL jar [closed]
- How can I print error stack trace in JSP page?
- How to pass parameter to jsp:include via c:set? What are the scopes of the variables in JSP?
- JSP : JSTL’s tag
- Iterating through a List Object in JSP
- How do I make a Java ResultSet available in my jsp? [duplicate]
- JSTL iterate over list of objects
- java.lang.NumberFormatException: For input string in JSP Page
- Retrieving cookie and array values in JSTL tags
- Can not find the tag library descriptor for “http://java.sun.com/jsp/jstl/core”
- What causes “java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name ‘command’ available as request attribute”?
- How do you import classes in JSP?
- Redirect to an external URL from controller action in Spring MVC
- Servlet for serving static content
- How do I get whole and fractional parts from double in JSP/Java?
- Spring Boot JSP 404
- Calling a java method in jsp
- No results returned by the Query error in PostgreSQL
- How to Properly Handle Exceptions in a JSP/Servlet App?
- How to send an email from jsp/servlet?
- Can I serve JSPs from inside a JAR in lib, or is there a workaround?