To use the re-direct method, no information is allowed to be passed out to
the client/buffer, i.e. out.println("ok"), remove this and all should be
well...
Krister
Analyst Programmer
____________________________________________________________________
http://www.akqa.com
mailto:[EMAIL PROTECTED]
T: + 44 (0)20 7494 9200
F: + 44 (0)20 7494 9300
M: + 44 (0)7967 020237
AKQA, Princes House, 38 Jermyn Street, St James's, London, SW1Y 6DN, UK.
Confidentiality notice:
The information transmitted in this email and/or any attached document(s) is
confidential and intended only for the person or entity to which it is
addressed and may contain privileged material. Any review, retransmission,
dissemination or other use of, or taking of any action in reliance upon this
information by persons or entities other than the intended recipient is
prohibited. If you received this in error, please contact the sender and
delete the material from any computer.
-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of ahfei
Sent: 11 May 2000 08:39
To: [EMAIL PROTECTED]
Subject: sendRedirect problem
dear all
i have a problem about jsp. follow is my code:
##############################################
//there are some other lines ,but haven't using the "Out" object.
if (flag) {
out.println("ok");
response.sendRedirect("club/register_club_success.htm");
}else{
response.sendRedirect("/club/register_club_error.htm");
}
######################################################
But sometimes it doesn't work ! my tomcat server issue some errors:
#####################################
Internal Servlet Error:
java.lang.IllegalStateException: Cannot forward as OutputStream or Writer
has already been obtained
at
org.apache.tomcat.core.RequestDispatcherImpl.forward(RequestDispatcherImpl.j
ava:130)
at
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:357)
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:381)
at
jsp._0002fjsp_0002fsave_0005fprofile_0002ejspsave_0005fprofile_jsp_6._jspSer
vice(_0002fjsp_0002fsave_0005fprofile_0002ejspsave_0005fprofile_jsp_6.java,
Compiled Code)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java,
Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled
Code)
at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.ja
va, Compiled Code)
at
org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java,
Compiled Code)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java,
Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled
Code)
at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,
Compiled Code)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java, Compiled
Code)
at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
(Ajp12ConnectionHandler.java, Compiled Code)
at
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java,
Compiled Code)
at java.lang.Thread.run(Thread.java, Compiled Code)
##########################################################
Can anybody help me? thanks in advance!
ahfei
[EMAIL PROTECTED]
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets