Tuesday, October 26, 2010

Re: How do I send program generated Images to my users?

> - Generate the image with a servlet on the fly (return the appropriate mime
> type and the image) or (if the images are small)

Great idea. HOW DO I DO THAT?

Sorry for the shouting, but I'm already generating the things on the
fly. If I knew how to return them other than as a file, I'd already
be doing that.

I've got a GWT client and a GWT Servlet. The GWT Servlet has an image
sitting in its memory. I want to get that image to the client. If
you can give me sample code, point me to sample code, or point me to a
well documented Java function, that would be great, and you would have
my full appreciation.

Telling me to "do X' is pointless, if you don't give me some way of
figuring out how to DO that X. Because if I knew how to do it, I
would have already done it, and not wasted everyone's time with these
questions.

Thank you,

Greg

On Oct 26, 12:42 am, Daniel Kurka <kurka.dan...@googlemail.com> wrote:
> Hi Greg,
>
> from my point of view there are to ways of doing this:
>
> - Generate the image with a servlet on the fly (return the appropriate mime
> type and the image)
> or (if the images are small)
> - you can encode them using base64 and set them as data in an image url
>
> Hope that helps
> - Daniel Kurka
>
> 2010/10/25 Greg Dougherty <dougherty.greg...@mayo.edu>
>
> > Hi all,
>
> > My servlet is creating images that I need to send to the client.  My
> > first thought was save the image to a file, then send the path to that
> > image to the client, which can then call new Image
> > (GWT.getModuleBaseURL () + imagePath);
>
> > This worked just fine in the development environment.  But when I
> > deploy to Tomcat, if I try to use a relative path, it does it from
> > where Tomcat was started, rather than from my module's base.  For
> > obvious reasons, I'd prefer not to try to save images to a hard-coded
> > path (makes it a bit difficult to move the app around).
>
> > Is there a clean way to get my module's base path, so I can save the
> > images relative to that?  If not, what IS the approved way to pass
> > program generated images to the client?
>
> > TIA,
>
> > Greg
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Web Toolkit" group.
> > To post to this group, send email to google-web-toolkit@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-web-toolkit+unsubscribe@googlegroups.com<google-web-toolkit%2Bunsubscribe@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-web-toolkit?hl=en.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment