wood burning stoves*
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
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: 41101
    
  45
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?


Ping & DNS - my free Android networking tools app
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: 41101
    
  45
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: 60780
    
  65

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 :-)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Obtain data?
 
Similar Threads
Why doesn't this JTable work??
How can i get test data
How to write Select query with ignore case
Doo we have good charting framework for SWT?
How can I get data types of properties of a Class/Bean