Announcement Announcement Module
Collapse
No announcement yet.
Newbie questoin : Accessing model from JSP scriptlet Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Newbie questoin : Accessing model from JSP scriptlet

    Hi all,

    I have returned a Hashmap called "map" from my Controller. How do I use JSP scriptlet to access the elements within this variable ?

    I have tried using
    <%
    if ${map.blah} == "hello"{
    %>
    woohoo
    <%}%>

    and it doesn't really work....

    Thanks for the help in advance!!

  • #2
    not sure if mal.blah should work but try map["blah"] should work.

    Comment


    • #3
      Why you not use jstl?
      Since you are using a map you have two option: key and value

      HTML Code:
      <c:if test="${situacao.key == 'hello'}">
          <div class="error">	
          </div>
      </c:if>
      Gilberto

      Comment


      • #4
        Sorry, I've forgot the other example, as Yann Perrin suggested:

        HTML Code:
        <c:if test="${situacao["blah"] == 'hello'}">  
        Note: the last one - with key word - , is more used in a loop.

        Comment

        Working...
        X