can java send variables back to html code
I am looking to write a small java applet to check to see if a server is up and running and if not stay where it is... The server in which it will reside does not have CGI support, but I am running a webserver on my school/home IP and I want the school website to access my schoo/home server if I have it up and running and if not use a default page...
Just thinking aloud, java progs can create a socket connection to a server... why can't an applet? (Though I know applets have very strict security guidelines for i/o writing to files).
What I'm envisioning is a simple applet where you input a URL address, click a button, and the applet will attempt to open a connection on port 80 (standard http port) and grab the html file headers.
Actually, I guess you don't want this to be interactive on the html side: just a matter of: "Either stay on the school site, or redirect to the home web site"
If successful, hmm, here's the tricky part: I guess if it is successful, you want the user/viewer redirected to the new server.... yep, yep, I think the URL class has a method to do that...
So, the pseudo-code would be something like this:
Applet tests to see if homeserver is active:
String homeurl = input from html applet param tag on school html page;
redirect to home web server;
stay on school server
I need to get ready for the day, but I'll take a try at this later and see if it just might be doable
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center