This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can Desktop application communicate with Web Page?

 
vinoth ramanathan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,
Here I got a situation.
1. I am having a login page of site with two entries namely username and password.
2. And a desktop application that should automatically enter the value to the above mentioned two text boxes( username and password) when I click the submit button of the desktop application.

How shall we do it.. How we can make the desktop application to communicate with web application.


vinoth


 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65227
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use the classes in the java.net package to generate requests, or make it easy on yourself and check out the Jakarta HttpClient project.
 
vinoth ramanathan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear ,
You are telling about passing the value through URL but I want that desktop application to enter the value in both the text boxes and then press enter


vinoth
 
Girish Vasmatkar
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming the web application is a Java implementation, you can have a call to a servlet from your Desktop application. The servlet in turn creates a bean(UserBean) and then having a JSP which use that bean(Created by the servlet) to fill the text boxes for you.

Remember, the servlet has to create a bean and forward the request to JSP.

I hope it helps.

Regards,
Girish
 
vinoth ramanathan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Girish,
Thanks for your reply . How can my desktop application will call the servlet.

I just want my desktop application to enter the values in that two text boxes. Hope you got my requirement.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
vinoth ramanathan wrote:You are telling about passing the value through URL

No, both approaches mentioned by Bear can generate POST requests just as well as GET requests.
 
Girish Vasmatkar
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

You can simply use HttpURLConnection class to create a connection to a servlet...




After setting some more attributes of this connection you can construct theparameters that you need to pass to the servlet as shown here.

Your servlet then handles further processing of data.

Regards,
Girish
 
vinoth ramanathan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Girish,
Thanks for the very clear example you sited. But how do I know the name of the parameter. Suppose you are creating website with login page in that page I want to login using that desktop application. How shall I do then.
 
Girish Vasmatkar
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi again,

You are the one who is going to mention the login parameters in the JSP page. And since you are the one who is developing the desktop application as well you can easily those login parameters in the desktop app while you are creating an HttpConnection.

Regards,
Girish
 
dhaval yoganandi
Ranch Hand
Posts: 35
Android Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
vinoth ramanathan wrote:Hi friends,
Here I got a situation.
1. I am having a login page of site with two entries namely username and password.
2. And a desktop application that should automatically enter the value to the above mentioned two text boxes( username and password) when I click the submit button of the desktop application.

How shall we do it.. How we can make the desktop application to communicate with web application.


vinoth




Hi vinoth,

Sorry to asking this question here.. But I am curious to know the real world application of this question. Can you justify it ?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic