Name: Genai 2008-04-02 17:41
Apoligies for posting the other half-done thread.....
So i'm trying to referance multiple values from a hashmap, then write them into a cookie, which will be called upon in the get method to print out objects of the same type. EG.
private final Map cars = new HashMap();
init(
books.put( "Ford", "Mondeo" );
books.put( "Ford", "Fiesta" );
books.put( "Mazda", "RX-2" );
books.put( "Mazda", "Someothercaridontknow" );
)
//post method
String make = request.getParameter( "make" );
String model = cars.get( make ).toString();
Cookie cookie = new Cookie( make, model );
If ford is selected, it'll only write fiesta to the cookie.
If mazda is selected, only the second mazda is in the cookie.
I'm failing to see how a while loop or iterator could be used?
Any help please?
So i'm trying to referance multiple values from a hashmap, then write them into a cookie, which will be called upon in the get method to print out objects of the same type. EG.
private final Map cars = new HashMap();
init(
books.put( "Ford", "Mondeo" );
books.put( "Ford", "Fiesta" );
books.put( "Mazda", "RX-2" );
books.put( "Mazda", "Someothercaridontknow" );
)
//post method
String make = request.getParameter( "make" );
String model = cars.get( make ).toString();
Cookie cookie = new Cookie( make, model );
If ford is selected, it'll only write fiesta to the cookie.
If mazda is selected, only the second mazda is in the cookie.
I'm failing to see how a while loop or iterator could be used?
Any help please?