• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Http Get external url socket

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I have to make a function that have to make a get into a public url, it will return me a plain text wich.

Depending on that i will make a validation.

I try to make it with the dojo ajax get method but since is a different domain it will not work ( only on Explorer).

How I can make that call to the external domain and manage the answer.

the url will be something like this.

htt://my.socket:8080/?option1=1&option2=2.

It can be with ajax or just a java class.
 
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you tried using the java.net api? Particularly, the URL and URLConnection classes?
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Panagiotis Kalogeropoulos wrote:Have you tried using the java.net api? Particularly, the URL and URLConnection classes?

And this answer has nothing to do with JavaScript.
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jose Maestre wrote:
I have to make a function that have to make a get into a public url, it will return me a plain text wich.



Can you change the output to JSONP, than it will be easy to make it work in any browser.

Modern day browser support CORS which will let you make cross domain calls. If you have to support older browsers, you need to use a proxy on the same domain or the JSONP call I suggested above.

Eric
 
Panagiotis Kalogeropoulos
Rancher
Posts: 99
Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

And this answer has nothing to do with JavaScript.



Very true. I did not pay attention to the keyword "dojo" and thought that it referred to core java. Apologies to the topic starter if I mislead him with my answer.
 
reply
    Bookmark Topic Watch Topic
  • New Topic