-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Yair,

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

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:parallel>
    <imageHack:image text="foo" />
    <imageHack:image text="bar" />
</imageHack:parallel>

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHSxP89CaO5/Lv0PARAmDwAJ9zyDEq/U1LCIRnkLs69v+yMsxJrACgrULl
bH2y/sAsOyQ+IZUbw3aRIzM=
=wAKM
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to