Paul Clapham wrote:Hi Steve, welcome to the Ranch!
I didn't understand what you meant by "didn't work" -- that's not very specific. It would help if you explained what was supposed to happen, and what happened instead, and showed us what error messages appeared, and other things like that.
However I decided to give the code a quick scan and I noticed this:
So yes, that code does actually bring in the names of the students. However it doesn't do anything with the names.
But that really doesn't matter yet because it's in the show() method, and you never call that method.
And you mentioned a JSP: the one you posted has a form which sends a student's name via the POST method. However the doPost() method of your servlet doesn't have any code which adds a student to the database.
Also I noticed in your web.xml that your servlet isn't in a named package. Servlets must be in a named package.
There's likely more problems beyond that -- I think you have written far too much code before testing anything. I would suggest starting again with something simpler: perhaps a servlet which just outputs the names of the students?
Steve Gates wrote:Unfortunately, only one servlet is needed and there should be these requests