Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java Open Source > Struts
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Struts section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 8th, 2008, 11:23 PM
Authorized User
 
Join Date: Sep 2008
Posts: 87
Thanks: 1
Thanked 0 Times in 0 Posts
Default dynamic display using logic tags

hi,
my jsp contains this logic:equal ,i want to make this dynamic based on the years which i get from the database.


<logic:equal value="year" property="years" name="announcementListForm">
            <Table style="year-button-archive" width="60%" >
                <tr>
                    <td class="gold" >
                        <a title="year">By Year:</a>
                    <td class="gold">
                        <a id = "2008" title="2008" href="../announcementList.do?year=2008">
                        2008
                        </a>&nbsp; | &nbsp;</td>
                    <td class="gold">
                        <a id = "2007" title="2007" href="../announcementList.do?year=2007">2007 </a>&nbsp; | &nbsp;
                    </td>
                    <td class="gold">
                        <a id = "2006" title="2006" href="../announcementList.do?year=2006">2006</a>&nbsp; | &nbsp;
                    </td>
                    <td class="gold">
                        <a id = "2005"title="2005" href="../announcementList.do?year=2005">2005 </a>&nbsp; | &nbsp;
                    </td >
                    <td class="gold">
                        <a id = "all" title="All" href="../announcementList.do?year=all">All </a>
                    </td>
                    </tr>
            </Table>
    </logic:equal>



if i get 2008,2006 i should display only 2008,2006 and all

<logic:equal value="year" property="years" name="announcementListForm">
            <Table style="year-button-archive" width="60%" >
                <tr>
                    <td class="gold" >
                        <a title="year">By Year:</a>
                    <td class="gold">
                        <a id = "2008" title="2008" href="../announcementList.do?year=2008">
                        2008
                        </a>&nbsp; | &nbsp;</td>

                    <td class="gold">
                        <a id = "2006" title="2006" href="../announcementList.do?year=2006">2006</a>&nbsp; | &nbsp;
                    </td>

                    <td class="gold">
                        <a id = "all" title="All" href="../announcementList.do?year=all">All </a>
                    </td>
                    </tr>
            </Table>
    </logic:equal>


how to make this dynamic based on the collection of years i get .

Thanks in advance
Raj


 
Old December 23rd, 2008, 03:42 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

You can loop through the collection!
__________________
- Rakesh
http://iam-rakesh.blogspot.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Looping through a list using logic tags problem aadz5 Struts 3 September 23rd, 2011 03:18 AM
MVC pattern - where does display "logic" go? planoie General .NET 0 September 4th, 2008 07:56 AM
Dynamic Date Display velcrobomb SQL Language 3 April 3rd, 2007 10:10 AM
Question regarding the display of <a> tags in xml tajjyarden XSLT 1 March 21st, 2007 11:54 AM
Mixing Data access logic and business logic polrtex BOOK: Professional Jakarta Struts 0 December 15th, 2003 07:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.