Applet-Servlet communication

I am trying to design a system wherein applets will be used to design the GUI and perform basic validations. The business logic resides in Servlets.
The front-end needs menus. Hence, I am not using HTML-servlets. Only the first servlet throws HTML with an embedded APPLET tag. With this APPLET tag I am fetching all the classes at the browser. This APPLET creates a main window(frame on top of the browser) from which other child frames will be created  as and when we click on the menu items.

In these child windows I will be accepting user input, packaging them in a serializable object and sending it over to some other servlet which processes the info contained in the object. The servlet might update a DB table or send some other object back to the originator (child) window.
(Mind you, this servlet does NOT send any HTML tag. HTMLs are sent only by the first servlet).

My questions are:
1) Is this a good architecture. Can someone suggest something better. In fact, Sun's Java Web servers admin console uses a similar architecture.

2) If the child window need to send a serializable object to the servlet, can it do so directly. Or, will it have to ge through the main frame or the applet...
How does it do it? Does it just open a connection to the servlet and write to it as is normally done in simple applet-servlet communication?

3) Does any one know whether the source codes are available for the corresponding .class files available in  with Sun's JavaWebServer2.0

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


Hi Shash,

1.Your architecuture ( Applet - Servlet ) communication is fine. No doubts about it due to your menu requirements.

Anyhow applet will do client side processing which a static HTML page won't do without using Scripts.

2.I Think applet_servlet communication through connection won't depend on Windows. No need to go to main Window.

3.Sorry. I don't know.

If You have already known applet to servlet communication, it is fine.

Otherwise visit this URLS   

Best of luck

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
(1)This is a good way according to me ,I think that if you want in CORBA/RMI you will have firewall issues which is removed in case of servlets if your design wherever it is going to vbe deployed is supporting HTTP ,of course one can argue that RMI/CORBA is also possible but I think that this is easier.

But this is easier said than done.
My first suggestion is buy Jason Hunter's book and read it cover to cover,see the thumbnails at

Jason has discussed among others
(1) HttpPostMessage class (name maybe different) which can be used to 'post' data to servlet from Applet.
(2)FileUpload to upload files from client to servlet
(3)Exception Logger servlet whereby all client exceptions are logged to a dedicated servlet , i would suggest add a log level ,i.e in Applet side

catch(Exception e)
//Note this is sent thru the HttpPostMessage
ExceptionLogger.log("String Classname where occurred with full package",
int logLevel(0=all log statements logged 5=reserved for critical errors),
"String Log Message"

(2) I would suggest that the applet sends to servlet in a single structured manner thru the HttpPostMessage class ,this eliminates code duplication ,and is horrible when u try to maintain that code later on ,u have to hunt around a zillion times.

(3)I dont think it's available if u r really desperate use a decompiler
SHashAuthor Commented:
It helped.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.