Announcement Announcement Module
Collapse
No announcement yet.
<c:out value="${variable}"/> form formBackingObject returns nothing Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • <c:out value="${variable}"/> form formBackingObject returns nothing

    Just a quick question.

    I have a formBackinObject that populates a variable ie pCount

    In my JSP I have a <form:hidden path="pCount"> that gets properly populated and generates proper HTML

    Code:
    <input id="pCount" name="pCount" type="hidden" value="2"/>
    which is exactly what I set it to in the formBackingObject.

    However, later in the JSP I try to retrieve pCount value with

    Code:
    <c:out value="${pCount}"/>
    but that returns an empty string.

    How do I get the number in pCount?

  • #2
    Include your command bean in the value. The form tags add that for you.

    Comment


    • #3
      Originally posted by Marten Deinum View Post
      Include your command bean in the value. The form tags add that for you.
      Yeah, after spending about 2,5 hours staring at the code, I realized I have to actually call the command I'm retrieving the value from.

      The correct way was to write

      Code:
      <c:out value="${command.pCount}"/>

      Comment

      Working...
      X