• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can Desktop application communicate with Web Page?

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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


 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 35
Android VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?
 
Politics is a circus designed to distract you from what is really going on. So is this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic