• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
Bartenders:
  • Himai Minh
  • Carey Brown
  • Frits Walraven

A cleaner way to display LinkedHashMap/ArrayList

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Crystal Bazil
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic