0
votes

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

1
and the html code is inside a form and the method is post - Isaac

1 Answers

1
votes

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);
%>