I am a new bie in JSTL me trying to display some values in JSP. Can anyone help me regarding this.
I want to display an arraylist values which are in the form of an value object. How can i display the values in jsp?
I add up list as a parameter parameter to other page say next.jsp
Make sure that you are using the following code to use the JSTL c tags. The tld will be present inside the standard.jar which you have downloaded from the Jakarta Taglibs project.
To iterate a list that contains just String objects it is well and easy. Say for instance I have an ArrayList object called names which contains the student names.
If you have a similar ArrayList with Student objects filled in, the use the following code
Please note that
Make sure that the standard.jar is in your class path.
If you have any custom objects in your ArrayList then make sure that it has got all the behaviors required. For instance, if you have got Student object inside your ArrayList make sure that the method getName() and getId() is available inside the Student object. The method name is case sensitive and even small errors like getID() instead of getId() will put the developers in the trouble and sometimes take long time to debug.
Try to involve a check before iterating the list to make sure whether the list is empty or not.
Ujjwal B Soni <baroda, gujarat, india> <+919909981973>
"Helping hands are better than praying lips......"
Joined: Mar 28, 2007
Do remember that ::::::::
In your servlet code set the object of your list as a session or request object...