9
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 don’t know why he uses the request
to get the data instead of the response
. And what’s the point of response
?
And when I will use the Answer.Somethings?
– Aline
When you wish to send something to the customer, in response to a request.
– Weslley Tavares