tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yair Ben-Meir" <>
Subject RE: multithreaded with taglibs
Date Tue, 27 Nov 2007 07:42:41 GMT
Thanks chris,
The generated output of the JSP is not html and not for an explorer...
that's why it has to be generated along the JSP work.

Btw - i thought of something: maybe the img tag will run a thread, return an
outout to the page with some new image name, and release the jsp to
continue. The thread will do the work and save the new image under the name
the tag returned to the page. At the end of the page, a "wait" tag will be
for waiting to whole of the threads to finish. That's the best thing I
thought of till now.

-----Original Message-----
From: Christopher Schultz [] 
Sent: Monday, November 26, 2007 8:44 PM
To: Tomcat Users List
Subject: Re: multithreaded with taglibs

Hash: SHA1


Yair Ben-Meir wrote:
> You're right about that - it is not for using over the web. Anyway, that's
> just an example. The main issue is to run the work of the tag in a thread
> without making the rest of the page wait.

I think you're hit the nail on the head right there: do the work in a

FWIW, I think this is an awful idea: if your page renders quickly, the
browser will attempt to load the images before your image threads have a
chance to actually generate the images. The only thing that /might/ work
is to do something like this:

    <imageHack:image text="foo" />
    <imageHack:image text="bar" />

The "parallel" tag just sets up an environment for the sub tags. Each
sub tag registers a job with the parent. The "end" method for the
parallel tag starts one or more threads to actually create the images,
then calls join() on each one. This will allow the images to be
generated in parallel instead of serial order.

You can't close the output stream of the web page until all of the
images are created, otherwise you risk broken images showing up on the
page. If you don't wrap your image tags in some kind of wrapper
("parallel" in my example), then you can't gather the threads in a sane
way in order to join() on them all.

Again, this sounds awful. Why not use http URLs instead of file urls?

- -chris

Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla -


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message