This is really frustrating, and I guess theres a gap in the small knowledge I have attained over the last two weeks of playing with JSP, but in my code below, the doGet method is not being called. I assumed when entering the url and hitting the jsp page, its respective Servlet's doGet method is inherently called. It could be a mapping issue, as I have not changed the web.xml, because I prefer the annotation based approach.
I managed to get the doPost working, by using a form, but I do not want to submit a form, its just a page which will render a table of data, nothing more.
Any help on this would be greatly appreciated, I had a thorough search on the web since last night and all posts I found were about submitting forms, but this is just to retrieve a value from the servlet back to the jsp.
When you say "hitting the JSP page" - what URL are you using? You shouldn't be directly going to the JSP address, you should be going to the servlet address, which then forwards to the JSP. Could that explain your problem?
And why are you importing your servlet into your jsp page ?
A JSP is a servlet, so your servlet and jsp should be totally separate from each other - the only connection, as Matthew says, is that your servlet forwards to your JSP.