java - JSP Page Forward Output Includes content from previous form -
the problem is: have page1.jsp submitted , forwarded page2.jsp. problem forwarded output should content in page2.jsp, instead of showing me content page1.jsp , content page2.jsp
i'm using requestdispatcher.forward(string)
don know why happening
ps: i'm using je 1.4
well seems have got method signature incorrect . per javaee 1.4 api:
public void forward(servletrequest request,servletresponse response) throws servletexception, java.io.ioexception
hence code should :
requestdispatcher dispatcher = request.getrequestdispatcher("page2.jsp); dispatcher.forward( request, response );
better , can use <jsp:forward>
standard action.
the jsp contains action stops processing, clears buffer, , forwards request target resource. note calling jsp should not write response prior action.
suggested reading:
Comments
Post a Comment