• Post Reply Bookmark Topic Watch Topic
  • New Topic

DropDown Menu does not work  RSS feed

 
Kitty Hankofer
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]
 
Dave Tolls
Ranch Hand
Posts: 2839
30
  • 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
Ranch Hand
Posts: 2839
30
  • 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
Ranch Hand
Posts: 2839
30
  • 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
Ranch Hand
Posts: 2839
30
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!