This servlet works well when I enter the correct data type in the required fields but with wrong entry and blank entry it only shows exception error. So how would I handle this through a message? how to code this?
You can try validation for blank entries which looks something like the following before storing your values to the database for the values you receive.Than parse it to Integer and store it to the database.
and for wrong entries ... use if else blocks as per your conditions