<H1>"Browser Hung"<h1>!_NEWLINE_!!_NEWLINE_!I have...
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   sunil_Chandurkar
Posted On:   Tuesday, March 13, 2001 07:30 AM

"Browser Hung" I have written code for Applet servlet communication, I am using JSDK2.1 following is Applet side code which is trying to read object from servlet... once its giving me proper output but during second call to this function for same servlet, hung the browser. Applet side code : public Object readFromServletEx(String servletName) throws IOException, Exception { URLConnection servletConnection = null; //***************************************** //* Get The Servlet's URL and Connect it //***************************************** String protocol= getCodeBase().getProtocol(); String host = getCodeBa   More>>

"Browser Hung"



I have written code for Applet servlet communication, I am using JSDK2.1 following is Applet side code which is trying to read object from servlet... once its giving me proper output but during second call to this function for same servlet, hung the browser.

Applet side code :


public Object readFromServletEx(String servletName)

throws IOException, Exception

{

URLConnection servletConnection = null;

//*****************************************

//* Get The Servlet's URL and Connect it

//*****************************************

String protocol= getCodeBase().getProtocol();

String host = getCodeBase().getHost();

int port = getCodeBase().getPort();

URL url = new URL(protocol,

host,

port,
"/examples/servlet/"+servletName);

servletConnection = url.openConnection();

servletConnection.setUseCaches (false);

InputStream in =servletConnection.getInputStream();

ObjectInputStream result=new ObjectInputStream(in);


return result.readObject();

}


Servlet side code :


public void doGet(HttpServletRequest request,

HttpServletResponse response)

throws ServletException, IOException

{

ObjectOutputStream outKFileObj =

new ObjectOutputStream(response.getOutputStream());


Vector repositoryVector = new Vector();

repositoryVector.addElement("Ten");

repositoryVector.addElement("Tweleve");


outKFileObj.writeObject(repositoryVector);

outKFileObj.flush();

outKFileObj.close();

}


please help me....


/sunil

   <<Less
About | Sitemap | Contact