tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vijay Kandy <Vij...@mailcode.com>
Subject RE: Sharing an object between servlets
Date Fri, 04 Oct 2002 16:16:23 GMT
I think I have an idea now. Thank you Sexton, Lin and Shapira! 

-Vijay

 -----Original Message-----
From: 	Sexton, George [mailto:gsexton@mhsoftware.com] 
Sent:	Friday, October 04, 2002 10:26 AM
To:	Tomcat Users List
Subject:	RE: Sharing an object between servlets

Go to:

http://www.mhsoftware.com/caldemo/servlet/login

Once you are logged in, choose Edit | Resource Types and click on the right
most icon by the word facility. This shows what I was speaking of. You might
want to change the date to "09/13/2002" and click on the "Go" button.

The ViewGantt servlet generates the HTML, and the PNG image. It saves the
PNG image on the user session. The graphic servlet just retrieves the image
from the session. It sets the mime type to image/png and sends it to the
client.

George Sexton
MH Software, Inc.
Home of Connect Daily Web Calendar Software
http://www.mhsoftware.com/connectdaily.htm
Voice: 303 438 9585


-----Original Message-----
From: Vijay Kandy [mailto:VijayK@mailcode.com]
Sent: 04 October, 2002 9:17 AM
To: 'Tomcat Users List'
Subject: RE: Sharing an object between servlets


Hmmm. I see what you are saying. But how does the HTML servlet write out the
image map data?

Thank you.
-Vijay



 -----Original Message-----
From: 	Sexton, George [mailto:gsexton@mhsoftware.com]
Sent:	Friday, October 04, 2002 9:48 AM
To:	Tomcat Users List
Subject:	RE: Sharing an object between servlets

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
session.

George Sexton
MH Software, Inc.
Home of Connect Daily Web Calendar Software
http://www.mhsoftware.com/connectdaily.htm
Voice: 303 438 9585


-----Original Message-----
From: Vijay Kandy [mailto:VijayK@mailcode.com]
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,
Vijay


--
To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message