Announcement Announcement Module
Collapse
No announcement yet.
JSTL message bundle with Spring Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JSTL message bundle with Spring

    How do I set a label property of a Spring radiobutton with a message from a bundle? e.g
    Code:
    <form:radiobutton	label="administrator" path="admin"    value="U" />
    How would I retrieve the "administrator" value from a bundle. I already have a bundle set up. If I do this
    Code:
    <fmt:message	key="info.administrator" />
    inside a td, I get the value but the trouble is accessing this value in a Spring control.

    Can somebody help?

  • #2
    Easiest way would be to use a c:set
    Code:
    <c:set var="bundleValue">
    <fmt:message	key="info.administrator" />
    </c:set>
    and for the radio button:
    Code:
    <form:radiobutton	label="${bundleValue}" path="admin"    value="U" />
    But I think it should be possible to do it dirrectly, bypassing the c:set
    Last edited by laura; Jul 28th, 2008, 05:33 AM.

    Comment


    • #3
      That worked, thanks Laura.

      Comment


      • #4
        Originally posted by laura View Post
        But I think it should be possible to do it dirrectly, bypassing the c:set
        Yes it is, try:

        Code:
        <fmt:message key="info.administrator" var="bundleValue"/>

        Comment


        • #5
          That's even better! Thanks cmelgar.

          Comment

          Working...
          X