Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

application servlet communication

 
Suman Dass
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!
I need my java application to communicate with my servlet probably using URLConnection class. Say I pass two parameters 'a','b' from the application and the servlet has a business logic that computes and returns the sum of 'a' and 'b' but not to a browser. How can I do it?
TIA
 
raimondas zemaitis
Ranch Hand
Posts: 104
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would use RMI.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13045
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will have to imitate the way a browser sends a GET request to a servlet, then parse the results out of the response you get.
Look at examples of GET URLs such as the one presently showing in your address window.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic