I have two servlet. The first (doGet) shows me the form and the second (doPost) processes the form
Here is my first servlet
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
Nodes nodes = nodes_dao.start(request);
int id = nodes.getId_node();
request.setAttribute("nodes", nodes);
request.setAttribute("id", id);
request.getRequestDispatcher(VUE).forward(request, response);
}
And here is my second servlet
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
String question = null;
String result = null;
question = request.getParameter("question");
result = request.getParameter("result");
Node_dao dao = new Node_dao();
try
{
dao.insert_result(result);
int left_id = dao.select_left_id(result);
dao.insert_question(question, left_id);
}
For example, how I can retrieve the id of the first servlet in the second?
Thanks