For Programmers: Free Programming Magazines  


Home > Archive > Java Help > January 2006 > applet talking to server (with ajax?)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author applet talking to server (with ajax?)
chuck

2006-01-29, 7:01 pm

Hi,

I have an applet that i want to have grab text from the server. I
have a php function that generates the text, right now just plain
text, but it could be anything xml, json, etc.

anyway, what is the best thing for me to do to have the applet
communicate with the php function on the server?

All the recent sun articles seem to deal with the opposite of what
i want, java server talking to a standard html page through ajax

Chuck
Lothar Kimmeringer

2006-01-29, 7:01 pm

chuck wrote:

> anyway, what is the best thing for me to do to have the applet
> communicate with the php function on the server?


Using
new URL("http://myserver/path/phppage.php").openConnection
and use the returned URLConnection for reading the PHP-
page's output.


Regards, Lothar
--
Lothar Kimmeringer E-Mail: spamfang@kimmeringer.de
PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)

Always remember: The answer is forty-two, there can only be wrong
questions!
Fabien Bergeret

2006-01-30, 8:02 am

chuck wrote:
> Hi,
>
> I have an applet that i want to have grab text from the server. I
> have a php function that generates the text, right now just plain
> text, but it could be anything xml, json, etc.
>
> anyway, what is the best thing for me to do to have the applet
> communicate with the php function on the server?
>
> All the recent sun articles seem to deal with the opposite of what
> i want, java server talking to a standard html page through ajax
>
> Chuck

To summerize : you have a web application, in which you want your client
to retrieve data from the server and to display it dynamically.
Using an applet implies that the client has a java plugin installed on
his computer, which is not always the case.
In both the cases, you'll need to have javascript code which will
display your retrieved data.
I'd say that the Ajax solution seems to be the best : doesn't need extra
requirements, minimize the number of different technologies used ...
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com