java - Why is a null value provided to my JSP snippet from the form submission? -


Hi, I want a user to get the age from a form and convert the string to an int and want to use somewhere else in the Java class.

.jsp snippet looks like this

  & lt;% string str = request.getParameter ("age"); Int convertInt = integer Parasont (str); & Gt%; & Lt;% myProgram.com Overheas (Not Converted);% & gt;   

However, I'm getting the HTTP status 500 - java.lang.NumberFormatException: Null

I think this form is being created for the first time in a UI class Is the field empty?

Is this a mistake and can I decide to thank it

The suggestion that .getParameter ("age") is empty back. This means that there is no parameter named "age" presented through the form, to ensure that "age" is the name of your form parameter, i.e. Input type = "text" id = "parameter" name = " age " value = "test"

They should ensure that cases are also match.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -