• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Displaying a table in JSP using JSTL tags

 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. I have a JSP page which should display a table with 2 columns : Code and Role
2. The data to be displayed in these 2 columns comes from a servlet which calls a DAO class.
3. The DAO class executes a select query and retrieves the data from database table and sets the data in an Arraylist jobList.
4.The ArrayList is passed back to the controller.
5. How do I display the values in this ArrayList as a table using the JTSL tags in the JSP.

Please let me know if I were to use ,<c:forEach> tag,how do I set the values using this tag.

 
Sheriff
Posts: 67756
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where is your code? What problems are you having with it?

Please ShowSomeEffort rather than expect the forum to provide you with code.
 
p hasini
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1.Input jsp page:


2. Javascript:


3. Conroller: Spring MVC framework


The above abcList contains the list of values

4. This modaltarget is configured in tiles-config.xml,views.properties file which routes the output jsp page

5.The service layer which returns an Arraylist calls Dao class

6. Dao class:
This class contains the JDBC logic select query to retrieve the data from the database table.The data Code and Role columns are added to a VO object and added to a Arraylist.

7. The business logic is fine.But I have modaltarget.jsp page which must display the retrieved values from Dao as a table ,as a list of values in a table using JSTL.

I cannot hardcode te values as shown above.I have to display the retrieved values from Dao from an ArrayList into this jsp.
Since I am new to JSTL,how do I output the values onto the jsp page using JSTL tags.
 
Ranch Hand
Posts: 171
Spring Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check out the url given below for sample JSTL creation program with necessary steps. JSTL
 
The City calls upon her steadfast protectors. Now for a tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic