• Post Reply Bookmark Topic Watch Topic
  • New Topic

GUIs w/ Servlets?

 
Joe Wolf
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In most of the servlet examples I've seen, servlets generate HTML code. Is it possible for a servlet to create a nice GUI on a web browser that a client can interact with? I know applets can.
 
Sean Casey
Ranch Hand
Posts: 625
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is from "Thinking in Java" by Bruce Eckel page 949 in the Servlet section:
"....but all your code has the platform portability gained from using java, and you have access to all the java apis (except, of course, the ones that produce GUIs, like Swing)."
I'm not sure if there are exceptions to this, as Mr. Eckel doesn't really go into it.

[This message has been edited by Sean Casey (edited July 05, 2001).]
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Obviously a servlet talking to a browser is limited to what the browser understands, but with current browsers using Javascript, etc. that can be pretty jazzy.
If you want to go the applet route you can easily have an applet talk to a servlet. Somewhere in the Javaranch code mines there are some classes that demonstrate passing serialized objects between applet and servlet - that gives you a lot of power.
Paul Wheaton wrote a chapter in my Java servlets and JSP book using these classes. Servlets can also create graphics or sound file resources on the fly.
Bill

------------------
author of:
 
Joe Wolf
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was reading through the online Servlet tutorial at java.sun.com and they stated that "servlets have no graphical user interface." So I guess they can't do anything graphically beyond what an HTML page can do.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!