• Post Reply Bookmark Topic Watch Topic
  • New Topic

APPLET -JSP TUNNELING PROBLEM

 
Shaji Ravindran
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • 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
 
ersin eser
Ranch Hand
Posts: 1072
  • Mark post as helpful
  • send pies
  • 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
  • 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();
%>
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!