I am trying to make each web page in applet.
So for the first page, I have written a LoginApplet.
What I want this to do is, when the user enters the login and password and clicks the submit button,
the applet should force the browser to send a POST request to the Web Server.
How can I do this?
I am using applets because
1) I am Java programmer and quite comfortable programming in Java.
2) I was asked to prototype a web based UI even though I had never done anything more than build simple HTML pages and simple applets.
My investigation into various tools and technologies told me that the in-thing nowadays was RIA and that there were plenty of ways to do this:
Given that I was a Java programmer, I opted to try out option a) :-)
So I self taught JavaFX and started developing the front end.
Hey, don't put down applets . . . JavaFX Applets 1.2 are way cooler (and faster) than Java Applets 1.0.2
But alas, this is only a prototype. I might need to move to Silverlight and the Evil Empire sooner than later :-)
Actually, my recent investigations into the Dark Side of the Force, tells me that the Dark Side is (presently) better than the Good side. LINQ, Attributes and Delegates makes up the two sided red light saber.
Anyway, I have a workaround to the question posted in this topic:
To pass parameters, I did the following: (but I am sticking with the above approach in my implementation)
Eeeww! Netscape reminds me of the Java 1.0.2 Applets, so I think that I will stay away from code like that . . .
I'm not arguing against applets, I'm arguing against using applets like web pages. Applet GUIs have way more capabilities than HTML GUIs, and one should use them accordingly (and not through a page-oriented approach).
A more modern way to access the surrounding web page than to use LiveConnect would be the Common DOM API.
Mathew Kuruvilla wrote:the logical flow for me was to to have the applet forward the request to the next page just like it is done in html.
Urm, in Web 1.0 HTML... :-D
That's called Ajax... ;-) (your option d)
In JavaFX, you can just switch scenes when you need to change dramatically the content (from login screen to main display, for example).
It didn't occur to me to have TWO scenes in one app. It makes more sense to do that than have the GUI as applets in different pages. On the other hand, my login.jar is 55KB, and my app.jar is 57KB. Let us say that the final app is 250KB.
In this case, will there be any noticeable difference in loading up the GUI in the two cases where the app is split into 80KB chunks as opposed to one 250KB chunk?
The reason why I did not go the Ajax route using Dojo was because the initial idea was to deliver the prototype in 3 weeks . . . When this got delayed (indefinitely?) I did read up on Ajax a bit and was trying to learn Dojo, but I never gained sufficient confidence that I could port whatever I had done in JavaFX to Dojo.
Anyway, at this point, porting if any, will be in Silverlight than Dojo.
I am not using JavaFX HttpRequest in my app as it does not support SSL. I am using HttpsURLConnection from Java instead, but I am using the PullParser from JavaFX.
Every snowflake is perfect and unique. And every snowflake contains a very tiny ad.
a bit of art, as a gift, the permaculture playing cards