| Author |
HashMap and For loop issue
|
Mike Jenkins
Ranch Hand
Joined: Jul 23, 2006
Posts: 57
|
|
I have this JSP where I have alot of fields with conditions. I would like to make it more efficient and use a for loop. Here is an example (showing 2 fields for example only): It prints out Joe Miller Now my attempt below to put this in a loop prints out null null: Please advise.
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
You're using the same string for the key and the value and neither of them is 'firstname' or 'lastname'. In any event, this is not really a JSP specific issue. This Java code in this scriptlet could be run from any Java program. Moving to Java In General (Beginner)
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
v ray
Ranch Hand
Joined: Mar 15, 2007
Posts: 223
|
|
yeah, what was said above is right. Try this instead: [ August 15, 2007: Message edited by: v ray ]
|
 |
 |
|
|
subject: HashMap and For loop issue
|
|
|