• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

APPLET -JSP TUNNELING PROBLEM

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Iam using applet-jsp tunneling,in the same jsp iam also doing some other work like interacting with the database,but when tunneling with the applet the jsp show's any one of the following exceptions
---Caught EOFException while reading the stream header
and
----OutputStream is already being used for this request
Could any body tell why this happens and what's the solution for this
Thanks
 
Ranch Hand
Posts: 1072
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
----OutputStream is already being used for this request
Taking a wild guess: May be you are trying to write to output stream directly, which you are not supposed to do in JSP ( rather use implicit out )
 
Shaji Ravindran
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
here is my jsp code:--
Please,check it
<%@ page import="java.util.Vector,java.io.ObjectOutputStream,java.io.ObjectInputStream"%>
<jsp:useBean id="chapterTreeDetail" class="ChapterTreeDetail" scope="page">
<%
ConnectionServlet conServlet=(ConnectionServlet)application.getAttribute(ConnectionServlet.KEY);
chapterTreeDetail.createConnection(conServlet);

%>
</jsp:useBean>
<%
System.out.println("----Inside treeindex-----");
String chapterId = "javaguymaca";
%>
<jsp:setProperty name="chapterTreeDetail" property="chapterId" value="<%= chapterId %>" />
<%
Vector v=chapterTreeDetail.getVector();
System.out.println("Vector in jsp="+v);
ObjectOutputStream os=new ObjectOutputStream(response.getOutputStream());
os.writeObject(v);
os.flush();
os.close();
%>
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JSP expects to be outputing a character stream, not a binary stream. You should serve that serialized object from a servlet.
I have never understood why people seem reluctant to create a servlet to do a servlet type job - it is no harder than JSP.
Bill
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic