Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: How to pass a value of a list to a hidden tag?

  1. #1
    Junior Member
    Join Date
    Oct 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to pass a value of a list to a hidden tag?

    I have the following code in my jsp:

    <c:forEach var="value" items="${MyList}" varStatus="loop">

    <tr><td><div id="Name1">Here:${value.name}</div></td></tr>
    <s:hidden id="Name" name="Name" value="%{value.name}"/>
    the html source is as following:

    <tr><td><div id="Name1">Here:My name is X</div></td></tr>
    <input type="hidden" name="Name" value="" id="Name"/>
    As demonstrated the div tag is showing the value.name correctly but the value attribute of hidden tag is empty. I could not find any solution because most of the solutions were not related to list.
    I changed it to ${value.name} but ran into this error: "According to TLD or attribute directive in tag file, attribute value does not accept any expressions"


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: How to pass a value of a list to a hidden tag?

    This thread has been cross posted here:

    https://www.javaprogrammingforums.com/stackoverflow.com/questions/12812805/how-to-pass-a-value-of-a-list-to-a-hidden-tag

    Although cross posting is allowed, for everyone's benefit, please read:

    Java Programming Forums Cross Posting Rules

    The Problems With Cross Posting


Similar Threads

  1. [SOLVED] 5 JPanels in 1 JFrame, last frame hidden.
    By HapticThreek in forum AWT / Java Swing
    Replies: 1
    Last Post: December 15th, 2011, 07:27 PM
  2. Array List; How to pass objects into another arraylist
    By Melvrick in forum What's Wrong With My Code?
    Replies: 3
    Last Post: October 24th, 2011, 05:55 AM
  3. Imported Class of Components are Hidden
    By polaris395 in forum AWT / Java Swing
    Replies: 3
    Last Post: July 25th, 2011, 09:35 AM
  4. 'pass by value' and 'pass by reference'
    By pokuri in forum Object Oriented Programming
    Replies: 5
    Last Post: January 26th, 2011, 11:30 AM