• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

how to implement Ajax with swing

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

Tell me how to implement AJAX(Asycronous Javascript And Xml) with swing,

Help me,

Thnaks in advance
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The "J" in AJAX stands for JavaScript, which is indicative of this being a technology used in web pages. In Swing apps (where you have complete control over (a)synchronicity), and can access a server without the user doing anything at all times, there's no special significance to the term.

What are you trying to do?
 
johny sill
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Thanks for reply

i am trying open jsp from swing using



But i want to send some data to jsp and display it,Then i get some reponse(data, ex:ArrayList) from that jsp to swing

How it is ,

Thanks in advancve
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How it is, is it's not going to happen. The JSP will send it's response to the server, not your Swing app.
 
johny sill
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for reply,

is there any other way,

Pls tell me,

Thaks in advance
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by johny sill:
Thanks for reply,

is there any other way,

Pls tell me,

Thaks in advance



Because JavaRanch is an international forum, many of our members are not native English speakers. For that reason, it's important that we all try to write clear, standard English, and avoid abbreviations and SMS shortcuts like Pls instead of Please. See here for more of an explanation. Thanks for understanding.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, so AJAX has nothing to do with this. There are two ways an applet (doesn't matter if it's Swing or AWT) can access web pages.

First, it can instruct the browser it's embedded in to show a particular URL in a frame. That's what the code you have does.

Second, it can access a URL which returns some data that the applet processes in order to display something. It sounds as if that's what you're trying to do. This FAQ wiki page talks about that.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can have your JSP write something to a database or filesystem that your Swing app connects to and gets the information.

It would help if you explained what kind of information your JSP is providing that your Swing app needs. Then we can provide better alternatives.
 
johny sill
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i done with servlets it works fine,

but i want to display something in that web page and gets the response
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Gregg is right, you need to explain in more detail what you want to do. It's not clear to me how the interaction

web server <--> applet <--> web page

should work, and what kind of data flows from where to where.
 
johny sill
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
send arraylist to webpage from swing and get some data(arraylist) from database then send these two arraylists to it swing
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by johny sill:
send arraylist to webpage from swing and get some data(arraylist) from database then send these two arraylists to it swing



What is the role of the webpage in this workflow? Could you cut that part out and still get what you need from the database? What does the webpage do exactly. I think we're getting closer.

Thanks.
 
Beware the other head of science - it bites! Nibble on this message:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic