I have this code to get data from a form:
@WebServlet(name = "computador", urlPatterns = {"/computador"})
public class computador extends HttpServlet {
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
float total = Float.parseFloat(request.getParameter("total"));
float preco = Float.parseFloat(request.getParameter("preco"));
float consumo = Float.parseFloat(request.getParameter("consumo"));
}
}
But I do not know why it uses request
to get the data, instead of response
. And what is response
?