[Opensource] Swing client
David Herron
davidh at 7gen.com
Thu Jul 4 08:46:09 PDT 2002
Turgay,
This is not so strange at all. Some of the message from Sun is
exactly what you're describing, and this message was all over the
place at Java One (but most people missed it 'cause they were
focussed on Web Services or J2ME)
JaWS is exactly the type of technology to use for this purpose.
Deploying the application is very simple -- one just writes a JNLP
file (a teensy XML file) describing the application, any jar files it
needs, and which JDK it runs on. One area in Java receiving lots of
work by Sun is JaWS. The next step is to place a link on a web page
to the JNLP file. Users install a current JRE (go to this page:
http://java.sun.com/products/javawebstart/) -- note that Mac OS X has
JaWS support built in -- and it automatically tells the browsers how
to handle JNLP files. If the browser doesn't figger it out, then the
browser will put up a dialog saying "help, I have this media type,
what do I do with it, what application to associate with it" and the
user just has to browse to where the JaWS application is located in
the file system. Once associated properly, the user just clicks on
the link, jaws starts, launching the app, etc. You can also store a
clickable icon within your system so you don't have to go through the
browser to launch the jaws app - you just click on the icon, just
like any other application.
You can create a much prettier, more responsive, more properly
constructed, better human factors, etc, application from Swing than
an HTML web page.
The only twist that you didn't discuss well is the comm protocol
between your application and the server side stuff.
Since expresso runs inside a web server, the most straightforward
approach is to do HTTP requests to a servlet. The servlet can be
simpler - you don't have to make it look pretty, but just have the
data.
SOAP (e.g. Web Services) are also a possibility on both client and server.
- David
At 15:02 +0300 7/4/02, Turgay Zengin wrote:
>Hello all,
>
>A strange(?) idea occured to me yesterday. Being tired of dealing
>with the ugliness of jsp(for me at least), being a very bad web page
>designer, I thought of getting rid of the browser altogether, and
>build a swing client. Will work like this:
>
>1) In the swing app, construct an object holding everything you want
>to send to the Expresso Controller (this may be an ArrayList of
>Strings?)
>2) Call the controller, don't forget to send the object
>3) The controller will get the object, do its processing, and will
>construct its own object holding what it needs to send back to the
>client
>4) The client receives the resulting object, and updates its interface.
>
>Did anyone try this? What is your opinion?
>
>My reasons are:
>-I am building apps for the intranet only, so I have control over
>the clients, absence of the browser will not be bad.
>-I'll be able to make nice GUI's (with the help of a GUI designer -
>did a say I was bad at GUI design?)
>-jsp, tag libraries will be history for me
>
>disadvantages:
>-I'll need to install the app to every client machine (use Java Web Start?)
>-I'll have to change the behaviour of Expresso Controllers. I'll
>need to de-serialize the object from the client, do the processing,
>serialize and send an object containing the reults. All other
>functionality need not be changed however.
>-Do you see any more disadvantages? I can't think of anything else.
>As I said, all my apps will be for internal use, I'll not need
>access from internet. If needed, I can still build web interfaces,
>since Expresso will be there.
>
>I already did some tests using basic servlets, and this approach
>works. Right now I am trying to login from swing
>(LoginController.processLogin). If successful, I'll continue.
>
>Will be happy to hear your comments.
>
>-Turgay Zengin
More information about the Opensource
mailing list