Solution 1 :

You must check jar file or maven.

The following is working correctly.

index.jsp

<form action ="show.jsp" action="GET" >
    <input type="text" name = "ad4" value="9" >
    <input type="submit" value="Test">
</form>

show.jsp

    String test =  request.getParameter("ad4");
    int testb = Integer.parseInt(test);
    out.print("Your test is: " + test);
    out.print("Your Test conversão é: " + testb);
%>

Problem :

I have in a HTML code:

form
input type=”text” name=”ad4″ value=”9″
input type=”submit” value=”Test EMAIL”
form (angle brackets taken off on purpose)

Then my JPS code:

        String test =  request.getParameter("ad4");
        int testb = Integer.parseInt(test);
        out.print("Your test is: " + test);
        out.print("Your Test conversão é: " + testb);

    %>

It Gives an error message: HTTP Status 500 – An exception occurred processing JSP page

Comments

Comment posted by Isaac

and the html code is inside a form and the method is post

Comment posted by Isaac

Thanks. It works fine now because the HTML form is in another JSP page. But what if I want the HTML code and JSP code to be in the same JSP page? In that case it gives a 500 -ERROR

By