• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DropDown Menu does not work

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hy guys,

i hope you can help me.
I want to create a dropdown menu with contents from a database.
You can see my Code in the attachement.
It does not work, but why?
I have a dropdown-symbol, but no contents.

Thank you

Kitty
CODE.PNG
[Thumbnail for CODE.PNG]
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That implies an empty list then, if nothing is appearing in the HTML.
Log a count of the values read from the database.
 
Kitty Hankofer
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for answering that quick.

How can I do that?
Could you give me a little piece of code?

I´m very new to Java and JSP...

Thanks!
 
Dave Tolls
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Depends where you're getting the abteilungen List from.
That's where I'd log the size.

If that size isn't correct then I'd look at the query used to populate it and run that directly against the database.
 
Kitty Hankofer
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hy,
here is my List.

What does the logger look like?

Thanks again !
AbteilungDao.PNG
[Thumbnail for AbteilungDao.PNG]
 
Dave Tolls
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, if you're doing web server stuff you should learn about log handling.
Log4J probably.

Failing that I suppose you could try Sys.out, but I would have no idea where that would end up...probably the server logs somewhere.

Also, could you post the actual code and not images?
In code tags.
It helps when trying to follow these things and, unlike images, they won't disappear when writing a post.
 
Kitty Hankofer
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, i have to learn some more things :)

Here´s the code:
JSP-File:



AbteilungController:



AbteilungDao:

 
Dave Tolls
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


You possibly already have a logging system set up if you have this in your code.
Add a log message using that into your Controller findAll method printing out the number of things returned from the DAO findAll method. You might need to store the returned list in a temporary variable.
reply
    Bookmark Topic Watch Topic
  • New Topic