• Post Reply Bookmark Topic Watch Topic
  • New Topic

swing to servlet communication  RSS feed

 
sujatha kothapalli
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi everybody,

can anybody help to solve my problem?
I want swing to servlet communication.I will enter data in the GUI and if i click submit that data has to be stored through servlet.

For ex,in JSP,html the data we entered will be get through
request.getParameter("");

From Swings to Servlets how it will be done?

If anybody knows then help me.Its needed immediately.
 
Terry Ong
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
short answer: I don't think it can be done.

Not sure if this is possible, but the way that i can think of is like this.
- Need to map servlet to a url.
- Open a HttpURLConnection from Swing using the url with your parameters in the url,something like:
http://yourapp/func1/servlet1.do?name=rancher&age=10

Seems a bit awkward, i think.
Not even sure if its the correct way.
Just my 2 cents worth.

Hope this helps.


[ December 21, 2006: Message edited by: Terry Ong ]
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The way to do it is described here. (It works the same way for applets and standalone applications.)
 
Terry Ong
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the tip. Ulf =)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!