This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes A cleaner way to display LinkedHashMap/ArrayList Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "A cleaner way to display LinkedHashMap/ArrayList" Watch "A cleaner way to display LinkedHashMap/ArrayList" New topic
Author

A cleaner way to display LinkedHashMap/ArrayList

Crystal Bazil
Ranch Hand

Joined: Sep 28, 2004
Posts: 38
I have a process I am trying to display using JSTL. The process is as follows:



So in theory the form could look something like this




I am storing my data for each section in an ArrayList of LinkedHashMaps whose values are ArrayLists.

And currently to display the data I am counting the items in the ArrayList and displaying accordingly.


It all works but.. it's ugly. I am just curious if there is an easier way to do this? Any direction would be appreciated!

Crystal
[ September 19, 2007: Message edited by: Crystal Bazil ]
Crystal Bazil
Ranch Hand

Joined: Sep 28, 2004
Posts: 38
First I removed the first ArrayList, not sure why I had that in there. Secondly, I dug around and found what I would like to accomplish. I am still running into problems. See below.



Current Display




Wanted Display





When I attempt the 2nd JSTL display I get the error :




I followed a couple examples I have found on the forums/google but each variation proves the same error message. I think I am maybe not setting things properly but am not sure what I need to do. Any direction on this would be appreciated. Thanks!

Crystal
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

javax.servlet.ServletException: Unable to find a value for "value" in object of class "java.lang.String" using operator "."

That message usually happens when you forget to wrap a value with the ${} chars, meaning that you're dealing with a string instead of an object.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Crystal Bazil
Ranch Hand

Joined: Sep 28, 2004
Posts: 38
Thanks Ben - That sorta helped but moreso confused me. I am still exetremely confused about what I am doing however so extended help would be appreciated. I am going to post relevent bits of my code so you can get the full picture.


Servlet


Method


Interface



Process.java




JSP



My question/trouble is how can I call the ArrayList items(affect,class_) by name when I iterate through the ArrayList? Apparently, I am not doing something right when I am creating the list but I am not sure what I should be doing.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: A cleaner way to display LinkedHashMap/ArrayList
 
Similar Threads
Hashmap display
Format column display - JSTL
JSTL List Help
Conditional alerts (was 'c:otherwise tag')
How to replace jsp script with jstl tag