http://localhost:8080/file.jsp?arg1=&arg2=11
runs successfully
http://localhost:8080/file.jsp?arg1=&arg2=
(empty value for argument ‘arg2’)
shows 500 Internal Server Error
The value of ‘arg2’ is used by an ‘int‘ variable in ‘jsp‘ using Integer.parseInt(request.getParameter("arg2")
How to fix it?
It is because you are trying to parse “” with
Integer.parseIntCheck Integer parseInt() API
When you do not pass any values Like below
Empty string will be passed in http request parameters.
So, better put empty check when parsing integer from string.