This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Servlets and the fly likes Obtain data? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Obtain data? " Watch "Obtain data? " New topic
Author

Obtain data?

Lenny Peter
Ranch Hand

Joined: Apr 22, 2008
Posts: 52

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
Marshal

Joined: Mar 22, 2005
Posts: 42913
    
  68
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

Joined: Apr 22, 2008
Posts: 52
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
Marshal

Joined: Mar 22, 2005
Posts: 42913
    
  68
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

Joined: Jan 10, 2002
Posts: 61761
    
  67

Apparently, the ninja-edit to the initial post has made the rest nonsensical.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Lenny Peter
Ranch Hand

Joined: Apr 22, 2008
Posts: 52
Sorry...I should change some codes. Will post those again.

Thanks :-)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Obtain data?