Hi,
I have
1)one
jsp page say p1.jsp which has html form and 3 submit buttons.
2)on submit it goes to p2.jsp, which depending on button name redirect to
page p3.jsp ->button1
p4.jsp ->button2
p5.jsp ->button3
I am redirecting as,
if(button.equals(new
String("button1")))
response.sendRedirect("http://localhost:8080/p2.jsp");
if(button.equals(new String("button2")))
response.sendRedirect("http://localhost:8080/p2.jsp");
if(button.equals(new String("button3")))
response.sendRedirect("http://localhost:8080/p3.jsp");
when I click on buttin1 on page p1.jsp , it throws
IllegalStateException if I comment all the outstream statements and response.sendRedirect statements before and after the response.sendRedirect("http://localhost:8080/p2.jsp"); statement it doesn't throws IllegalStateException .
But I need have response.sendRedirect statements if button2 or button3 are clicked.
Is there was to handle this?
Another thing is if I use <jsp:forward ......> in all if statements it works fine but when I click the browser back button from p3.jsp it give me Page expired warning and I need to refresh the page to go back to p1.jsp . With the response.sendRedirect (" ") statement refresh problem is solved but
IllegalStateException rises!!!
I realy appreciate any help in this.
thakns,
padmashree