Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Struts - A MVC web framework
Tomcat - JSP/Servlet container
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
JSP - A mailing list about Java Server Pages specification and reference
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
Having problems with stored PrintWriter.

Having problems with stored PrintWriter.

2003-12-16       - By derrick.robertson@(protected)

 Back
Reply:     1     2     3     4     5     6     7     8     9     10     >>  

Im having a problem with PrintWriter in a servlet.

I am trying to store users PrintWriter and use them again at a later date to
output javascript commands to the browsers at a later date. it store as a
coyotewriter - org.apache.coyote.tomcat5.CoyoteWriter@(protected)

To do this they are dumped in a hashtable. But they dont seem to work when i
try to write output with them? Is there any way around this??

this is the error I get but only when i include the flush() line.

If anybody can help it would be most appreciated

To write out to users browser - retrieves from hashtable
-- ---- ---- ---- ---- ---- ---- ---- ------
System.out.println("Is this even working: Receivedevent!!!!!!! "
+useroutputstream);
PrintWriter usersout = (PrintWriter)useroutputstream.get("derrick");
usersout.println("Testing received event status"+receivedevent);
usersout.print("<script type=\"text/javascript\">");
usersout.print("receivedEvent('your dinner is ready');");
usersout.print("</script>");
//extraline
usersout.flush(); -- --> Exception: lbp.LBPServlet.doGet(LBPServlet.java:98)

I dont know if this is also part of the problem but if i use the .flush(), it
seems to start throwing exceptions.

java.lang.NullPointerException Source code of java.lang.NullPointerException
org.apache.coyote.http11.InternalOutputBuffer Source code of org.apache.coyote.http11.InternalOutputBuffer(InternalOutputBuffer.java
:547)
org.apache.coyote.http11.Http11Processor Source code of org.apache.coyote.http11.Http11Processor(Http11Processor.java:735)
org.apache.coyote.Response Source code of org.apache.coyote.Response(Response.java:223)
org.apache.coyote.http11.InternalOutputBuffer Source code of org.apache.coyote.http11.InternalOutputBuffer(InternalOutputBuffer.java
:518)
org.apache.coyote.Response Source code of org.apache.coyote.Response(Response.java:532)
org.apache.coyote.tomcat5.OutputBuffer.realWriteBytes(OutputBuffer.java:392)
org.apache.tomcat.util.buf.ByteChunk Source code of org.apache.tomcat.util.buf.ByteChunk(ByteChunk.java:439)
org.apache.coyote.tomcat5.OutputBuffer.flush(OutputBuffer.java:350)
org.apache.coyote.tomcat5.CoyoteWriter.flush(CoyoteWriter.java:119)
lbp.LBPServlet.doGet(LBPServlet.java:98)
javax.servlet.http.HttpServlet Source code of javax.servlet.http.HttpServlet(HttpServlet.java:743)
javax.servlet.http.HttpServlet Source code of javax.servlet.http.HttpServlet(HttpServlet.java:856)
org.apache.catalina.servlets.InvokerServlet Source code of org.apache.catalina.servlets.InvokerServlet(InvokerServlet.java
:466)
org.apache.catalina.servlets.InvokerServlet Source code of org.apache.catalina.servlets.InvokerServlet(InvokerServlet.java:180)
javax.servlet.http.HttpServlet Source code of javax.servlet.http.HttpServlet(HttpServlet.java:743)
javax.servlet.http.HttpServlet Source code of javax.servlet.http.HttpServlet(HttpServlet.java:856)
filters.ExampleFilter Source code of filters.ExampleFilter(ExampleFilter.java:149)
filters.ExampleFilter Source code of filters.ExampleFilter(ExampleFilter.java:149)

©2008 junlu.com - Jax Systems, LLC, U.S.A.