I am developing an employee scheduler Java web applicatyion where an employee can specify days they will be out of the office for things such as vacation, business travel, etc...I have a simple mechanism for adding/editing/deleting these records. But I am struggling with the JSTL and which collector I should be passing to the jsp for the forEach looping.
Ultimately I need to display a table on a jsp page that looks omething like this:
October 2010
Employee Sun Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu ...
1 2 3 4 5 6 7 ...
Abate * * * * * [E]
Adams * * * * * [E] [E]
Benson * * * * * [E] [E]
Where [E] would be a list of items or events against that employee for that particular day
And this is a sample list of events from a sql call:
EVENT_ID BADGE EVENT_TYPE_ID EVENT_TYPE_NAME EVENT_S_DATE
1 134311 5610 Business Travel 2010-10-08
2 101379 7646 Floating Holiday 2010-10-11
3 005396 3600 Vacation 2010-10-12
4 134311 1318 Military 2010-10-12
5 134311 0575 Sick Time 2010-10-12
6 101379 6652 Unpaid 2010-10-18
7 111243 0575 Sick Time 2010-10-29
My first approach was to use nested hashmaps and key it with the day but I had difficulty reference the value in the map using JSTL because of the issues with using numbers for keys (My key was the cell number offset by the start day, October starts on day 5 or Friday).
http://stackoverflow.com/questions/924451/jstl-access-a-map-value-by-key
http://stackoverflow.com/questions/3919025/jstl-and-hashmap-not-working.
I foresee me making a bunch of loops in the servlet that populates some type of container to accomplish this.
I'm looking for at least something like "Oh, nest a List in a Map and stuff that in another map" to get me started.