tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sexton, George" <>
Subject RE: Sharing an object between servlets
Date Fri, 04 Oct 2002 14:48:29 GMT
I have done what you are attempting. The problem with decoupling as
suggested by others is that you end up duplicating the logic to create the
image, and the image map.

My solution was to have the servlet generate the graphic and save it on the
session. The HTML servlet wrote out an image tag to another servlet that did
nothing but retrieve the generated session from the image.

Perhaps a more scalable approach would be to write the image out as a file,
and have a servlet that reads the file. A reference could be saved on the

George Sexton
MH Software, Inc.
Home of Connect Daily Web Calendar Software
Voice: 303 438 9585

-----Original Message-----
From: Vijay Kandy []
Sent: 04 October, 2002 8:28 AM
To: 'Tomcat Users List'
Subject: Sharing an object between servlets

Dear All,

We are building a map tool - to draw maps and show some data on them. Now, I
have this situation. I have a servlet that gets coordinates from the
database and draws the map on its OutputStream (the content type is set to
png image). There is another servlet (content type is text/html) that embeds
the URL of the first servlet. This servlet also gets coordinates from the
database, and populates them over the image so I can do some image map or
mouseOver() tricks using javascript. I was wondering if there was a way to
make just one call to the database and share the coordinates between the
servlets. Right now, I will try any thing!

Thank you,

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message