I think this thread has gotten me very confused.

You have uploaded files, presumably you know where they are and can
identify them. You want to get those files to display in your browser.
In order to do that you create an <img src=""/> tag that contains a
URL as the value of the src attribute that points to your server that
can serve the file.

That endpoint can be a Tapestry page that accepts enough information
to find identify your file and return a StreamResponse to send the
data back for that image request.

It seems like you are thinking you need to craft a URL that actually
points to the file in the filesystem, but that's not the case.

Josh

On Thu, Mar 10, 2011 at 2:24 PM, Rich M <rich...@moremagic.com> wrote:
> On 03/10/2011 04:21 PM, Thiago H. de Paula Figueiredo wrote:
>>
>> On Thu, 10 Mar 2011 17:49:14 -0300, Rich M <rich...@moremagic.com> wrote:
>>
>>> Okay, that makes sense. Is there a way to use the StreamResponse instead
>>> of the URL then to display an image in the browser?
>>
>> Unless you want to generate one of that data URLs
>> (http://en.wikipedia.org/wiki/Data_URI_scheme), you'll need to generate an
>> URL for it just like it was described in the thread you linked.
>> StreamResponses don't have URLs by themselves.
>>
>>> My application will be able to more reliably serve the images via the
>>> StreamResponse rather than the URL
>>
>> Why?
>
> Primarily because I can't think of a reasonable way to build a URL to the
> file that could actually be served. I wish I was more knowledgeable about
> servlets and such, but if my application is running from a WAR, how would I
> get any files into that context? In development I use maven directory
> structure and the mvn jetty:run command to execute. From here I know I can
> place files relatively from my context in src/main/webapp/<where-ever> and
> serve it as an Asset. However, when I have to deploy it into production and
> run it as a WAR in stand-alone Jetty, I think this approach is no longer
> viable.
>>
>>> so I'd like to consider that approach, or at least know if how to do it
>>> for curiosity sake.
>>
>> Wise words. :)
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to