Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Obtain data?

 
Lenny Peter
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

How can I obtain the data that should be displayed (as some kind of HTML list or) ...
I have tried to solve...but.... ?
suggestion?
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Lenny Peter
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

thanks

 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64623
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apparently, the ninja-edit to the initial post has made the rest nonsensical.
 
Lenny Peter
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry...I should change some codes. Will post those again.

Thanks :-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic