Java Forum / First Aid / February 2006
HELP: How to approach a project (? Web Start)
Gerorge Reece-Howe - 12 Feb 2006 23:35 GMT Hi,
I was hoping someone could help me on how it would be best to approach a situation?
This is a rough sequence of what should happen.
-User logs into a secure webpage. -User enters information on a form -Form info is saved to a database on the web server -User accesses a Java program on the on that webpage (Applet? Webstart thingy?) -This Java program is passed parameters from the webpage that executes it (and can it be verified that the person accessing it is that same as the logged in user) -The user puts further information -That program accesses 1: Information from the web-server database (ie the form data entered by the user, but anything really) 2: A private key from the hard drive of the user (the program would, of course, have a proper ceritficate) -The program then sends the information to a secondary secure web server, awaits a response and recieves return data. -The program saves the return data to the database of the original server (the one the user is logged in to) -Program ends
The program would be about 1 - 1.5 MB and would be frequently accessed by the user.
At first I thought the Java Program could be an applet, but the frequency of the user accessing it would cause it to be slow and unwieldy. I saw something on Web Start, and my understanding of it is that it works like an applet, but allows it to be cached on the users drive. If this is so, would it still be able to recieve parameters from the web page that launched it? If the version on the web site is updated, will the cache of the user update automatically?
I am relatively new to java and, while I am comfortable programming, and can create a decent java application, I am totally lost with all the different 'flavours' of Java, applications, applets, Web Start, Beans, Struts, JNLP, and probably many others I've never even heard of.
Could someone tell me what is the best (sorry, I know 'best' is a little ambiguous) method or approach to use for this program?
Thanks a lot.
Gerorge.
Roedy Green - 13 Feb 2006 01:19 GMT >At first I thought the Java Program could be an applet, but the frequency of >the user accessing it would cause it to be slow and unwieldy. If it as a small Applet, it will run reasonably quickly. The problem is starting an Apple for the first time when the browser loads Java.
To use the RAM the browser takes for you own purposes and generally get better control of your environment, ditch the browser and go with JAWS that has the auto-update benefit of Applets with controlled caching.
See http://mindprod.com/jgloss/javawebstart.html
 Signature Canadian Mind Products, Roedy Green. http://mindprod.com Java custom programming, consulting and coaching.
Roedy Green - 13 Feb 2006 01:21 GMT > If this is >so, would it still be able to recieve parameters from the web page that >launched it? If the version on the web site is updated, will the cache of >the user update automatically? JAWS runs independently of a browser, though it can be kicked off with a URL. JAWS would get its information either by directly communicating with the user or with the server.
If it absolutely had to communicate with the browser you would need to write an Applet or JavaScript that would squirrel what it needed away somewhere on disk.
 Signature Canadian Mind Products, Roedy Green. http://mindprod.com Java custom programming, consulting and coaching.
Gerorge Reece-Howe - 13 Feb 2006 01:57 GMT >> If this is >>so, would it still be able to recieve parameters from the web page that [quoted text clipped - 8 lines] > write an Applet or JavaScript that would squirrel what it needed away > somewhere on disk. Thanks for this.
Basically, it needs to be launched from a browser and be able to identify itself with the logged-in user that has launched it. Can it recieve post parameters, ie http://.../my.jnlp?sessionid=[thesessionid]&userid=[userid], so that it can at least verify back on the server that the session and user is valid?
Sorry if this is mentioned on the reference you sent me, I haven't fully gone through it yet.
Cheers,
Gerorge
Roedy Green - 13 Feb 2006 08:28 GMT >Basically, it needs to be launched from a browser and be able to identify >itself with the logged-in user that has launched it. Can it recieve post [quoted text clipped - 4 lines] >Sorry if this is mentioned on the reference you sent me, I haven't fully >gone through it yet. again no. You would have to put the information somewhere on disk when the Jaws app could find it.
One possible such place is in a dynamically generated JNLP file which can pass parameters to the JAWS app and control it in many ways.
 Signature Canadian Mind Products, Roedy Green. http://mindprod.com Java custom programming, consulting and coaching.
Gerorge Reece-Howe - 13 Feb 2006 11:20 GMT >>Basically, it needs to be launched from a browser and be able to identify >>itself with the logged-in user that has launched it. Can it recieve post [quoted text clipped - 12 lines] > One possible such place is in a dynamically generated JNLP file which > can pass parameters to the JAWS app and control it in many ways. Thanks again. I had thought that this might be the way to go, have the JNLP file created by a PHP script with the appropriate parameters.
Cheers,
Gerorge
Roedy Green - 13 Feb 2006 13:47 GMT >Thanks again. I had thought that this might be the way to go, have the JNLP >file created by a PHP script with the appropriate parameters. you could generate it either on the client or the server.
the JNLP file contains a reference to where the master copy is, perhaps itself, which it then consults. So out of date JNLP files still work.
 Signature Canadian Mind Products, Roedy Green. http://mindprod.com Java custom programming, consulting and coaching.
Gerorge Reece-Howe - 13 Feb 2006 21:40 GMT >>Thanks again. I had thought that this might be the way to go, have the >>JNLP [quoted text clipped - 5 lines] > perhaps itself, which it then consults. So out of date JNLP files > still work. The program should not be able to work without a valid login, ie without the user being on the web page, so I thought the server-side option would be best.
How would you get the JNLP on the client system anyway?
Roedy Green - 13 Feb 2006 01:24 GMT >I am relatively new to java and, while I am comfortable programming, and can >create a decent java application, Happily JAWS apps can be identical to standalone apps. All you do is write a additional JNLP file to handle the delivery. Think of it is a free install and auto-update program.
It is a very conservative approach. You don't box yourself in. JAWS could disappear tomorrow, and you would just repackage your code with a different installer.
JAWS has other optional features. Read my little hymn of praise to it at http://mindprod.com/jgloss/javawebstart.html
 Signature Canadian Mind Products, Roedy Green. http://mindprod.com Java custom programming, consulting and coaching.
Gerorge Reece-Howe - 13 Feb 2006 01:43 GMT > JAWS has other optional features. Read my little hymn of praise to it > at http://mindprod.com/jgloss/javawebstart.html Thanks a lot for this, it's great stuff! I shall read and digest.
Cheers,
Gerorge
Rhino - 13 Feb 2006 13:48 GMT > Hi, > [quoted text clipped - 43 lines] > > Thanks a lot. I'm not positive but I *think* a servlet could probably do what you want to do. A servlet would have far less limitations than an applet and probably involve much less setup than Java Web Start. (I was looking at Roedy's article on Web Start yesterday and was really put off by how much there is to set up.)
I've done some of the things you're describing in servlets and I'm pretty sure that most of it can be done. I'm just not sure about the whole private key business since I haven't worked much with those and never within a servlet.
I just thought I should mention servlets as a possibility since you don't seem to have thought of them and no one else mentioned them either.
-- Rhino
Roedy Green - 13 Feb 2006 15:46 GMT On Mon, 13 Feb 2006 08:48:21 -0500, "Rhino" <no.offline.contact.please@nospam.com> wrote, quoted or indirectly quoted someone who said :
> (I was looking at Roedy's >article on Web Start yesterday and was really put off by how much there is >to set up.) Huh? It is a fraction of the farting around you do for a server app.
 Signature Canadian Mind Products, Roedy Green. http://mindprod.com Java custom programming, consulting and coaching.
Rhino - 14 Feb 2006 05:03 GMT > On Mon, 13 Feb 2006 08:48:21 -0500, "Rhino" > <no.offline.contact.please@nospam.com> wrote, quoted or indirectly [quoted text clipped - 5 lines] > > Huh? It is a fraction of the farting around you do for a server app. Well, I'm relatively comfortable with the stuff you need to do to write a servlet; I spent several weeks teaching myself how to do them.
I'm not as comfortable with Java Web Start. Just reading through your page on it led me from one hassle to another so that I gave up pretty early on. For instance, your page gave me a warning that "Your browser is not configured properly for Java Web Start *.jnlp and application/x-java-jnlp-file MIME types" but didn't tell me what was wrong or how to figure it out. Then your SetClock application didn't work, perhaps because of the aforementioned problem. I looked at my file associations and there appeared to be a proper file association for .jnlp so I started to feel like I was getting contradictory indications. I anticipated a variety of posts to a variety of forums to figure this out and decided that was just too much bother to get to Square One, especially when there appear to be umpteen other things to do to get Java Web Start up and running.
I may look at it all again some other time but I just can't spare the time to do all that is required this week....
-- Rhino
Roedy Green - 14 Feb 2006 15:53 GMT On Tue, 14 Feb 2006 00:03:12 -0500, "Rhino" <no.offline.contact.please@nospam.com> wrote, quoted or indirectly quoted someone who said :
>"Your browser is not >configured properly for Java Web Start *.jnlp and >application/x-java-jnlp-file MIME types" but didn't tell me what was wrong >or how to figure it out. I intended for you to click HELP if you did not know what to do. Obviously, that is not obvious. I am working on a smarter scheme that gives more explicit instructions.
Unfortunately, my beloved Kinesis DSK keyboard packed it in, possibly to revive yet again after wet cleaning. It died coincidentally after it was attacked by a huge bumblebee. I am making do with a French AZERTY keyboard (similar to QWERTY). I am back to hunt and peck. So it will take a while.
The French keyboard has some intriguing features.
Punctuation is lower case, number upper. Very nice!
Number key plus altGr give a third option, allowing a reasonably direct way to get extra symbols.
Accent dead keys. You hit accent then letter. Some accented combos have a dedicated key.
() are centrally positioned and lower case. Nice for programming.
If my Kinesis comes back to life I will look into swapping upper and lower case on the top numeric row.
You might wonder why I did not simply use a DSK driver to get a close approx to my Kinesis layout. The feel is totally different. I can't type at all by reflex. I may be forced to that eventually if I can't go Kinesis.
 Signature Canadian Mind Products, Roedy Green. http://mindprod.com Java custom programming, consulting and coaching.
Roedy Green - 14 Feb 2006 16:47 GMT On Tue, 14 Feb 2006 00:03:12 -0500, "Rhino" <no.offline.contact.please@nospam.com> wrote, quoted or indirectly quoted someone who said :
>Your browser is not >configured properly for Java Web Start *.jnlp and >application/x-java-jnlp-file MIME types" but didn't tell me what was wrong >or how to figure it out. I have my mildly improved help scheme uploading now.
If you have trouble there are three causes.
old browser. old or no Java screwed up earlier install or uninstall, usually from installing old JVMs after new.
I wish Sun would tackle this with a sanity check/autorepair program. It is too daunting for naive users. Even you, a programmer, get cold feet.
 Signature Canadian Mind Products, Roedy Green. http://mindprod.com Java custom programming, consulting and coaching.
Gerorge Reece-Howe - 13 Feb 2006 21:38 GMT >> Hi, >> >> I was hoping someone could help me on how it would be best to approach a >> situation? >> >> This is a rough sequence of what should happen. ....
> I'm not positive but I *think* a servlet could probably do what you want > to do. A servlet would have far less limitations than an applet and [quoted text clipped - 9 lines] > I just thought I should mention servlets as a possibility since you don't > seem to have thought of them and no one else mentioned them either. Thanks for the response.
I did consider servlets, but I didn't think a servlet could have access the files on the clients hard drive like you could with a signed applet or webstart thing.
The Webstart setup doesn't seem to complex though, have the applet/applecation on the server, have the JNLP xml file on the server, pointing to the applet, have a web page on the server, with a link to the JNLP.
That's how it works isn't it?
Rhino - 14 Feb 2006 05:05 GMT >>> Hi, >>> [quoted text clipped - 31 lines] > > That's how it works isn't it? I really couldn't say. My knowledge of Java Web Start is negligible. I probably just prefer servlets because I've done servlets, some of them quite complex, in the past. I just thought I'd mention them in case you hadn't considered them. Obviously, you have and ruled them out so I'll butt out of this conversation now....
-- Rhino
Free MagazinesGet these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...
|
|
|