Do I need to set something to enable applet-servlet communication in Tomcat4.1.29?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   amit_parnerkar
Posted On:   Tuesday, January 20, 2004 08:59 PM

Trying to send object to servlet URL secureServletURL = new URL("http://localhost/security/secureservlet"); URLConnection servletConnection = secureServletURL.openConnection(); servletConnection.setDoOutput(true); servletConnection.setUseCaches (false); servletConnection.setDefaultUseCaches (false); // Specify the content type that we will send binary data servletConnection.setRequestProperty("Content-Type", "application/octet-stream"); DataBean dataBean = new DataBean(); dataBean.setAmount(ivjamount.getText()); ObjectOutputStream outputToServlet = new ObjectOutputStream(servletConne   More>>


Trying to send object to servlet

URL secureServletURL = new URL("http://localhost/security/secureservlet");


URLConnection servletConnection = secureServletURL.openConnection();


servletConnection.setDoOutput(true);

servletConnection.setUseCaches (false);

servletConnection.setDefaultUseCaches (false);

// Specify the content type that we will send binary data


servletConnection.setRequestProperty("Content-Type", "application/octet-stream");


DataBean dataBean = new DataBean();

dataBean.setAmount(ivjamount.getText());

ObjectOutputStream outputToServlet = new ObjectOutputStream(servletConnection.getOutputStream());

// serialize the object

outputToServlet.writeObject(dataBean);

outputToServlet.flush();

outputToServlet.close();

   <<Less
About | Sitemap | Contact