• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

DropDown Menu does not work  RSS feed

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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]
 
Master Rancher
Posts: 4082
47
  • Mark post as helpful
  • send pies
  • 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
  • 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
Master Rancher
Posts: 4082
47
  • Mark post as helpful
  • send pies
  • 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
  • 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
Master Rancher
Posts: 4082
47
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
OK, i have to learn some more things :)

Here´s the code:
JSP-File:



AbteilungController:



AbteilungDao:

 
Dave Tolls
Master Rancher
Posts: 4082
47
  • Mark post as helpful
  • send pies
  • 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.
 
If I'd had more time, I would have written a shorter letter. -T.S. Eliot such a short, tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!