Geeta Ramani wrote:
> Your problem may be the line "response.setContentType("text/html");". Remove it and
>I think things
> will work.
Either that or just set a bugger buffer at the top of your jsp:
<%@ page buffer=�16kb� %>
btw - do you want to 'insert' something in your page or do you want to show a whole
different page. If
the latter is the case forward is fine. But if you want to insert something you should
definitely use
include.
When you use forward, all the stuff you have already written is deleted from the
internal buffer
(usually 8k). if you have already written more than 8k, you get the exception you
mentioned in your
mail.
When you use include, the page that is included is simply inserted in the outputstream
and you don't run
into trouble with the buffer. But beware - it is not possible to set header from
within an included
page.
ciao,
-hendrik
- - - - - - - - - - - - - - - - - - - - - - - - - - -
tagtraum industries http://www.tagtraum.com/
jo! small&smart 2.2 servletengine
Java Server & Servlets The web-application book
The WebApp Framework http://www.webapp.de/
>
>
> Regards,
> Geeta
>
> help java wrote:
>
> > hi guys,
> > i am a very typical problem .The moment i try to
> > forward my JSp to another JSp it's give me a blank
> > page.I am using XML and JSP.But when i view the view
> > source in browser it's give me this error.
> >
> > javax.servlet.ServletException: Error: Attempt to
> > clear a buffer that's already been flushed
> > 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.ServiceInvocationHandler.method(ServletWrapper.java,
> > Compiled Code)
> > at
> > org.apache.tomcat.core.ServletWrapper.handleInvocation(ServletWrapper.java,
> > Compiled Code)
> > at
> > org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,
> > Compiled Code)
> > at
> > org.apache.tomcat.core.Context.handleRequest(Context.java,
> > Compiled Code)
> > at
> > org.apache.tomcat.core.ContextManager.service(ContextManager.java,
> > Compiled Code)
> > at
> >
>org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java,
> > Compiled Code)
> > at
> > org.apache.tomcat.service.TcpConnectionThread.run(TcpEndpoint.java,
> > Compiled Code)
> > at java.lang.Thread.run(Thread.java, Compiled Code)
> >
> > i had try sendRedirect and requestdispatcher, and
> > jsp:forward but all in vain.But the same thing if i
> > use in the beginning of JSp it work fine.
> > here is the code for ur reference i am using.
> >
> > if(!insert_or_not)
> > {
> > //response.sendRedirect("gunjan.html");
> >
>//getServletContext().getRequestDispatcher("UserError.jsp").forward(request,response);
> > //response.setContentType("text/html");
> > %>
> > <jsp:forward page="UserList.jsp"/>
> > <%
> > }
> > %>
> >
> > Any help will be appreciated..
> > thanx in advance.
> >
> > gunjan
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
> > http://photos.yahoo.com/
> >
> > ___________________________________________________________________________
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> > of the message "signoff SERVLET-INTEREST".
> >
> > Archives: http://archives.java.sun.com/archives/servlet-interest.html
> > Resources: http://java.sun.com/products/servlet/external-resources.html
> > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html