Hi!
I have 2 jsp pages page1.jsp and page2.jsp and 1 servlet, on the form action of page1 I called the servlet setting certain parameters (i.e. name), on the doPost method of my servlet, I called requestDispatcher to load page2.jsp. On page2.jsp I want to retrieve the value from page1 (for example: String s = request.getParameter("name" My problem is that when i click the submit button of page1, the url of the new page is /servlet/<servletnae> instead of page2.jsp. When I tried to use sendRedirect I get a null pointer exception. It seems that I can't pass the parameter name from page 1 to page 2 even if in the doPost method of my servlet, I set req.setParameter("name",name); How can I correct this error?
Thanks!
Raymond
I have 2 jsp pages page1.jsp and page2.jsp and 1 servlet, on the form action of page1 I called the servlet setting certain parameters (i.e. name), on the doPost method of my servlet, I called requestDispatcher to load page2.jsp. On page2.jsp I want to retrieve the value from page1 (for example: String s = request.getParameter("name" My problem is that when i click the submit button of page1, the url of the new page is /servlet/<servletnae> instead of page2.jsp. When I tried to use sendRedirect I get a null pointer exception. It seems that I can't pass the parameter name from page 1 to page 2 even if in the doPost method of my servlet, I set req.setParameter("name",name); How can I correct this error?
Thanks!
Raymond