Hi, I have a jsp page (which is actually an XML file, with some java code scriplets in it). When a client request through a ejb, in my ejb I will connect to this jsp page, so that it excutes and then I will have to send the input stream from this httpconnection to the client, which is over a wire. So I need some serializble object as a return value. I was wondering if anyone could help me out here. Thanks, Sony Gam
I am not sure what the exact issue is. I am assuming that you have a InputStream to an XML doc. You need to pass this to some remote object. Your question is how to do this. Well, I think you can write this to a String and send the String over. Do you think that is a feasible/possible solution.
Joined: Jun 20, 2001
Hi Ganesh, thyanks a lot for responding. I am sorry if I could nnot make myself clear. Well, here is my jsp page. <%@ page import="javax.ejb.*,javax.rmi.*,javax.naming.*,examples.entities.entity.*" %> <Tag1> <Tag2> <% InitialContext ic = new InitialContext(); EntityHome sHome = (EntityHome)PortableRemoteObject.narrow((EntityHome)ic.lookup("server.entities.Entity"),EntityHome.class); Collection entities = null; Entity entity;
%> </Tag2> <Tag1> As you can see, it is actually a xml page, but using JSP just for the java scriplets in between. (What this code does is queries the database for some values using an Entity bean) Now I have a client who invokes an ejb bea on my server. Then in the server code, using a httpurlconnection object I just connect to the url location where the above jsp page is located. so the java code embedded in the page gets executed and I have the complete xml file, which looks like this: <Tag1> <Tag2> <Entity id="5" Description="xyz"/> </Tag2> </Tag1> Now I have to send the resultant stream to the client as retrun value for the method he invoked earlier. What I thought I could do is obtain the inputstream object from the httpurlconnection object I previously used. But as the BufferedInputStream is not serializable I can not send it. so I was wondering if someone could suggest me something, here. Thanks, Sony Gam