You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Michael Echerer <me...@tngtech.com> on 2004/04/06 12:37:59 UTC

Howto pass large objects (that cannot be in the URL) to AbstractService.service() implementations?


Hi all,

the scenario is as following:

In the end I want to write a component that represents and renders mainly an image.

This component should make use of a custom AbstractAsset since it's an image.
(Although I might also think about calling the service directly in the component
class)
The rendering of the image (stream) should be done in a custom AbstractService
implementation as here's the place to write to an output stream.

To make it worse the whole component, asset, service should be bundled in a
component library. Thus everything must be completely parametrized.

I already have a more or less working piece of code doing the above except that
it's not fully parametrized yet, so it's fixed to one application at the moment.

The main issue is that I have a potentially big object that is currently in the
Visit object. It contains information that is required to configure and render
an image specifically generated for the requesting user. Thus there's no way
around this object (also different api).

Of course, in the AbstractService.service() I can access this object via the
Visit, but that means that I'm fixed to my Visit implementation.
The point is: For a standalone libary that I could drop in into any application
I should not require a specific Visit interface for obtaining such an
object. Instead I should shift this task to each application by just passing
such an configuration object as a component parameter whenever needed which is
passed through to the service() method doing the work.

Looking into the AbstractService.getLink() I see that I could pass an array of
parameters. 
Unfortunately they are finally encoded in the URL by constructLink. For a big
object this isn't a good idea (in fact my test code didn't work anymore when I
tried this).


In other words: I have an AbstractService.service() method were I like to render
the image and stream it to the ResponseOutputStream. To make this work, 
I need a large object passed somehow as a parameter. Thus it can't be encoded in
the URL. It should not be obtained from the Visit since it would make the
service depend on a specific applications visit implementation. 
Nevertheless the object is certainly stored in the session as it holds things
like zoom level, center etc. that's needed later for rendering again.

So how to do this? I'm really stuck here.
Thx.
Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org