This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
What do you mean by "obtain"? Unless the "createList" method fills the map with some useful data, it will be empty. Did you mean to call "carData.restore()" somewhere along the way?
Joined: Apr 22, 2008
Ulf Dittmer wrote:What do you mean by "obtain"? Unless the "createList" method fills the map with some useful data, it will be empty --> yes, this is my problem. Did you mean to call "carData.restore()" ---> yes I do somewhere along the way?
The Servlet should create a CarData object and use the GetBasicList() method to obtain
the data that should be displayed as some kind of HTML list.
Joined: Mar 22, 2005
Now I'm confused. The "restore" method is being called -even though that does not happen in the code you posted- yet the "carData" map is still empty?
Regarding the createList method: Map.containsKey returns a boolean - which looks wrong in the context of an HTML option. Also -assuming that a car's serial number is the first parameter of the Car constructor- the containsKey method will never return true, because none of the example cars have such a low serial number.