Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

swing concept

 
kalpana kp
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to connect swing to servlet?I create textfield in swings.how to pass this text field value to servlet.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!

Firstly you would not send a textfield to a servlet, you would send the data (or text). Also, it doesn't matter that the end point is a servlet, you are just sending it across HTTP.

Now you just need to work out how to get a Swing application to send data across the web. Check out the HTTP Client in the Apache Commons libraries in http://jakarta.apache.org

Dave
 
kalpana kp
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi there

Just i need how to pass data from swings(i:e swing Jtextbox) to servlet or jsp
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David has answered your question.
Swing is desktop technology and servlets are server technology.
If they are to communicate it will have to be over HTTP.

The easiest way is to make your swing app a web client.
The easiest way to do that is to use the libraries in the link that David has already given you.


Check out the HTTP Client in the Apache Commons libraries in http://jakarta.apache.org
 
kalpana kp
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there thanks for advising use libraries but how to use?give me sample code for passing date from swing to servlet
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No problems. You just need this and this.

Dave
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic