I have a servlet load_plan, which its doPost method loads a plan with this code:
int id = Integer.parseInt(request.getParameter("id"));
I have another servlet hire_new_plan, which its doGet method sends the id to the load_plan servlet.
hire_new_plan doPost() --> load_plan doGet().
How can I send the id from the doGet method so that I can capture it with the request.getParameter()
in the doPost method of the receiver servlet?
There are two problems as I have read.
First of all, I can't call the doPost method from another servlet's doGet method.
Secondly, it seems as if the request.setAttribute("id", id)
doesn't match with the int id = Integer.parseInt(request.getParameter("id"));
. I execute in the receiver servlet.
What can I do to fix this?