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:

how avoid java code in jsp-files?


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -