You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by an...@wipro.com on 2004/08/23 11:40:24 UTC

Swing communicating with a Servlet.

Hi,
I am trying to send data from a swing application to a Servlet.
I am having the following piece of code within the action event of a
button
URL callback = new
URL("http://localhost:8080/UMSDriver/SwingToServlet");
URLConnection c = callback.openConnection();
c.setDoOutput(true);
c.setUseCaches(false);
System.out.println(c.getContentType());
But the value that is printed out in the console is "null".
Why is it so? Where am I going wrong?
Regards,
Anunay Ashish.



Confidentiality Notice

The information contained in this electronic message and any attachments to this message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged information. If
you are not the intended recipient, please notify the sender at Wipro or Mailadmin@wipro.com immediately
and destroy all copies of this message and any attachments.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: Swing communicating with a Servlet.

Posted by Shakeel <sh...@globalnorthstar.com>.
try followings
or set content type explicitly

con.setDoInput(true);
con.setDoOutput(true);
con.setUseCaches(false);

S H A K E E L   A H M A D
(EE, SCJP, SCWCD & SCBCD)

Northstar Technologies, Inc.



-----Original Message-----
From: anunay.ashish@wipro.com [mailto:anunay.ashish@wipro.com]
Sent: Monday, August 23, 2004 2:40 PM
To: tomcat-user@jakarta.apache.org
Subject: Swing communicating with a Servlet.



Hi,
I am trying to send data from a swing application to a Servlet.
I am having the following piece of code within the action event of a
button
URL callback = new
URL("http://localhost:8080/UMSDriver/SwingToServlet");
URLConnection c = callback.openConnection();
c.setDoOutput(true);
c.setUseCaches(false);
System.out.println(c.getContentType());
But the value that is printed out in the console is "null".
Why is it so? Where am I going wrong?
Regards,
Anunay Ashish.



Confidentiality Notice
The information contained in this electronic message and any attachments to
this message are intended
for the exclusive use of the addressee(s) and may contain confidential or
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or
Mailadmin@wipro.com immediately
and destroy all copies of this message and any attachments.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org