Can Desktop application communicate with Web Page?
vinoth ramanathan
Greenhorn
Joined: Oct 01, 2009
Posts: 22
posted
0
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.
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
Joined: Apr 24, 2008
Posts: 199
posted
0
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
Joined: Oct 01, 2009
Posts: 22
posted
0
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
Marshal
Joined: Mar 22, 2005
Posts: 35249
7
posted
0
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.
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
Joined: Oct 01, 2009
Posts: 22
posted
0
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
Joined: Apr 24, 2008
Posts: 199
posted
0
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.
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 ?
a.k.a stalker.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: Can Desktop application communicate with Web Page?