Mel Calvin

Greenhorn
+ Follow
since Sep 11, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mel Calvin

I have a hashmap of arrays, if I iterate over the map and prints the elements, it will print the arrays as a whole. I want to print the elements of the arrays which is not that easy, however, I have come oup with a solution:


This code works..
16 years ago
JSP
ok, sourceList is the id of what?

regards.
16 years ago
Consider the following code:

ArrayList list1 = new ArrayList();
ArrayList list2 = new ArrayList();
ArrayList list3 = new ArrayList();
list1.add(0, "list1-row1");
list1.add(1, "list1-row2");
list1.add(2, "list1-row3");
list2.add(0, "list2-row1");
...
list3.add(2, "list3-row3"):

HashMap map = new HashMap();
map.put("List1", list1);
map.put("List2", list2);
map.put("List3", list3);
request.setAtttribute("MAP", map);
forwarding to the jsp-page...

If I in a jsp-page wanted to print out the first rows the three arrays, how could that be achieved? I.e. retrieve only one element per iteration per array. I just can't get this to work..

Regards,
Mel.
[ September 17, 2007: Message edited by: Bear Bibeault ]
16 years ago
JSP
A problem with this code is that it will print out the whole list. How would you retrieve/print out e.g. the first elements of all arraylists in one iteration and then the second elements etc?
16 years ago
Yes that is working, thanks. However that will print both arrays, I found out that to print only one of them can be done with:
16 years ago
Hi,

I have a LinkedHashMap that contains ArrayLists. Something like this:




How can I iterate over the elements in the arrays in the map in a JSP page?
Do I need to use the nested or logic tag? Can anyone show me an example of how to print out e.g. "list1 row1"?

Thanks.
16 years ago
Aah.. I knew there was a SQL-side solution to this. My SQL skills are limited, thanks for the help!
Hi,
If I have a sql query that looks like this:

and result is returned as a collection of dynabeans. When I want to retrieve the data from the updated_date column I need to write like this:

with the "column name" truncated down to 32 chars, else it won't work. Now, this isn't an elegant solution. Anyone have better solution for this?

Thanks.