Calling a Servlet through a Swing using java.net.URLConnection

Hii JavaitesI need to call a servlet from a Swing application.I want to pass a xml from Swing to servlet.Plz tell me how to go abt it.
[162 byte] By [help_eachothera] at [2007-10-2 20:30:36]
# 1
Servelet are simple Java classes. You can use the DocumentBuilder class to form xml request and call ur servelet's mtd passing this documentbuilder object ......
Rohan.Desaia at 2007-7-13 23:13:41 > top of Java-index,Core,Core APIs...
# 2
But i want to know how to call a servlet from swing application
help_eachothera at 2007-7-13 23:13:41 > top of Java-index,Core,Core APIs...
# 3
You've answered your own question in the title. Create a URL to your servlet, get a connection from it, write what you have to write and read the response. It's all there in the API.And don't do any of this in the AWT thread or your GUI will freeze.
ejpa at 2007-7-13 23:13:41 > top of Java-index,Core,Core APIs...
# 4
Can u provide me a code snippet to get started.Thanx in advance
help_eachothera at 2007-7-13 23:13:41 > top of Java-index,Core,Core APIs...
# 5
Not really, no.
ejpa at 2007-7-13 23:13:41 > top of Java-index,Core,Core APIs...
# 6
Thanx for guiding me.
help_eachothera at 2007-7-13 23:13:41 > top of Java-index,Core,Core APIs...
# 7
A good article on this topic can be found at http://javaboutique.internet.com/tutorials/Swing/-M
manoj.kottama at 2007-7-13 23:13:41 > top of Java-index,Core,Core APIs...