I am accepting input from a user which direct the parameters here..
I am doing all the required stuff but yet code is not working
There must be some error in date object.
I am using mysql as backend
I have used same kind of code in jsp that is working fine but this is creating error
But you are wise to move the code out of a JSP and into a servlet. Modern JSPs should have no Java code in them.
Ulf Dittmer wrote:Note that "processRequest" is not a method of the Servlet API, so it will never be called. I'm guessing you meant to override "doPost" instead - you should get in the habit of using the "Override" annotation.
This is a NetBeans thing and it's one of my pet peeves about an otherwise good IDE. The servlet template in NetBeans creates a processRequest method and inserts a call to that method inside of both doPost and doGet. It's very bad form in my opinion and encourages a bad habit. I've gotten into the habit of deleting it and using the correct method. The template can be changed but I haven't yet put the effort into doing so.
The servlet template in NetBeans creates a processRequest method and inserts a call to that method inside of both doPost and doGet.
So that's where it comes from - I had thought there must be a popular servlet tutorial that does it this way. Treating GET and POST interchangeably is very bad indeed, by violating the HTTP specification.