In my JSP page, I let users input their dollar balance.
Then I catch this in servlet as: String input = req.getParameter("balance");
How do I check if input
variable is double? I know how to use ParseDouble
, but I don't want to catch the exception. Instead, I want to pass my own error message to JSP so that users can see it when they have typing error.
Can someone help me?