|
Re: Running a JSP or Servelet from RAP [message #479032 is a reply to message #479014] |
Sat, 08 August 2009 11:41 |
Benjamin Muskalla Messages: 338 Registered: July 2009 |
Senior Member |
|
|
Hi Emile,
take a look at this FAQ entry:
http://wiki.eclipse.org/RAP/FAQ#How_to_provide_download_link .3F
It's the same procedure but without the Content-Disposition header.
Greets
Ben
Emile wrote:
> Hi,
>
> I'm writing a custom widget that displays an image.
> The HTML tags are generated on the server, along with an image that is
> stored in the Session variable. My intention was to pass the relative
> path to the image to the img src tag in html and use it to draw the
> image on the client, or have something like img
> src="GetImage.jsp?MyImage.png" which will call a JSP that read the image
> binary from the session and pass it back to the client.
>
> I was able to store my image in a temporary file in a temp directory,
> outside of the Jetty root. However, I don't know how to retrieve Jetty's
> relative path to assign it to the img src tag in html. Also, I doubt
> Jetty will allow reading files from directories oustide of its root, for
> security reasons.
>
> If I keep my image in a session, how can I send it to the custom widget
> JavaScript to render in the browser?
>
> I would appreciate any hints or informaiton on this topic.
--
Benjamin Muskalla | EclipseSource Karlsruhe
http://www.eclipsesource.com | http://twitter.com/eclipsesource
|
|
|
|
|
Re: Running a JSP or Servelet from RAP [message #479236 is a reply to message #479014] |
Mon, 10 August 2009 12:01 |
Emile Messages: 4 Registered: August 2009 |
Junior Member |
|
|
Hi Ben,
I have one more question related to this widget.
In my widget, I'm passing the img tag as html and setting it in my qooxdoo javascript as such:
document.getElementById(this._id).innerHTML
My innerHTML text output is similar to the following:
<img src=\"/rap?custom_service_handler=GetChartHandler&img=chart90321cc2-62f4-4cb8-9bfe-99dbb82ba942.png&id=rvvp5qlkd41b_5\" usemap=\"#map90321cc2-62f4-4cb8-9bfe-99dbb82ba942' border=\"0\">
<map name=\"map90321cc2-62f4-4cb8-9bfe-99dbb82ba942\">
<area shape=\"poly\" coords=\"242,135,231,164,220,174,159,135\" My sample map href=\"javascript:;?sector=0&label=NSW&value=1&percent=11.76\">
<area shape=\"rect\" coords=\"241,155,282,182\" My sample map href=\"javascript:;?sector=0&label=VIC&value=1&percent=11.76\">
</map>
This displays the image, but I can't click on the defined map areas to trigger action or a function on the RAP server side.
How can I have the href links (javascript in my case) call the RAP widget on the server passing the sector, label and value parameters found in the href links inside the map tag?
Cheers,
Emile
|
|
|
|
Powered by
FUDForum. Page generated in 0.03868 seconds