|
The code I have
attached should throw an exception (using Integer.parseInt) when a none
numerical value is entered and therefore display a message but it doesn't even
though I enter things like too many and uikehfkjsdhiwefd.
Any suggestions on
this would be helpful.
public void
process (ServletContext sc, HttpServletRequest request, HttpServletResponse
repsone)
throws IOException, ServletException { String project = request.getParameter("project"); if (project.equals("")) { throw new IOException("Project must must not be empty!"); } String hours = request.getParameter("hours"); try { Integer.parseInt(hours); } catch (NumberFormatException e) { e.printStackTrace(); throw new IOException("Hours must be an Integer! hours = " + hours); } Debug.log (this, "process", ""); } |
- Problem Sachin S. Khanna
- Re: Problem David Chisholm
- Re: Problem Willie Wheeler
- Re: Problem Craig R. McClanahan
- Re: Problem brian
- Re: Problem Abraham Kang
- Problem Chulet, Mahesh
- Problem Chulet, Mahesh
- problem Mistroni Marco
- Re: Problem Routledge, Carl
- Re: Problem Glenn Wearen
