Hi,
I can only use servlet spec 2.2. So i have used a jsp tag to compress the
"bodycontent" and then send to the clint browser.
For some codes it is working fine but for some it gives an error "response
already commited"
---------- Jsp-----------------
<ymca:compress>
jsp goes here it includes some java script extrenal file calls "src tags"
</ymca:compress>
------------end jsp--------------------
-----------------Tag handler extend BodyTagSupport and only doEndTag method is
extended------------------
HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
HttpServletResponse response =
(HttpServletResponse)pageContext.getResponse();
encodings = request.getHeader("Accept-Encoding");
String OutPut = "";
try {
BodyContent bodyContent = getBodyContent();
if (bodyContent != null) {
OutPut = bodyContent.getString();
OutputStream outA = response.getOutputStream();
if ((encodings != null) && (encodings.indexOf("gzip") != -1)) {
response.setHeader("Content-Encoding", "gzip");
outWriter = new PrintWriter(new GZIPOutputStream(outA),
false);
outWriter.write(OutPut);
outWriter.close();
}
}else {
bodyContent.getEnclosingWriter().write(OutPut);
}
}catch(IOException ioe) {
throw new JspTagException("Please Contact Your System
Adminstrator IO= "+
ioe.toString());
}
return EVAL_PAGE;
---------------------------------------------------end tag
handler---------------------
Can anybody please suggest why is this error and how to solve it ?
Thanks and Regards
Raj
EXT 6146
-------------------------------------------------------------------
The contents of this e-mail are confidential to the ordinary user
of the e-mail address to which it was addressed and may also be
privileged. If you are not the addressee of this e-mail you should
not copy, forward, disclose or otherwise use it or any part of it
in any form whatsoever. If you have received this e-mail in error
please notify us by telephone or e-mail the sender by replying to
this message, and then delete this e-mail and other copies of it
from your computer system. Thank you.
We reserve the right to monitor all e-mail communications through
our network.
___________________________________________________________________________
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