0
I have the following form:
<form action="backend" method="get">
<h1>Bem vindo ao Teacher Points</h1>
<h3>Sistema web para calcular pontuação de Professores.</h3>
<table>
<tr>
<td>Meses no cargo:</tr>
<td><input type="text" name="mes_cargo"/></tr>
</tr>
<tr>
<td>Meses na lotação:</tr>
<td><input type="text" name="mes_lotacao"/></tr>
</tr>
<tr>
<td>Meses na carreira adjunto:</tr>
<td><input type="text" name="mes_adjunto"/></tr>
</tr>
<tr>
<td>Meses na carreira titular:</tr>
<td><input type="text" name="mes_titular"/></tr>
</tr>
<tr>
<td>Magisterio: </tr>
<td><input type="text" name="magisterio"/></tr>
</tr>
<td>
<input type="submit" value="Calcular pontuação"/>
</td>
</table>
He is sending the values to my Servlet called "backend", the problem is when making the request, I made the following code:
int mes_cargo = Integer.parseInt(request.getParameter("mes_cargo"));
int mes_lotacao = Integer.parseInt(request.getParameter("mes_lotacao"));
int mes_adjunto = Integer.parseInt(request.getParameter("mes_adjunto"));
int mes_titular = Integer.parseInt(request.getParameter("mes_titular"));
int magisterio = Integer.parseInt(request.getParameter("mes_magisterio"));
but when I send it to Servlet it returns an HTTP Status 500 error with the following message
HTTP Status 500 - Internal Server Error
type Exception report
messageInternal Server Error
descriptionThe server encountered an internal error that prevented it from fulfilling this request.
exception
java.lang.NumberFormatException: null
note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 4.1.1 logs.
GlassFish Server Open Source Edition 4.1.1
And I don’t know what to do, probably I’m not doing the right request and ta null in all imputs
Where is the error accused? Are you receiving the values in the backend? The code is in the same form address?
– Leandro Angelo
error is accused right after I click on html Submit "Calculate score"
– Arthur
I receive the values with the request I commented upstairs, but I don’t know if it’s correct
– Arthur
They are in the same project but in different folders, my Serrvlet is in "Teacher Points Web src java br with teacherpoints control" Already my html is in "Teacher Points Web"
– Arthur