WebSphere Portal Server - access to image file, help!!

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Portal Server > February 2004 > access to image file, help!!





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author access to image file, help!!

2004-01-19, 2:57 pm

is there a place on portal where I can store an image so that my portlet can access it? I can not put in under the portlet hierachy in development time. I need some other storage for the image and it can be accessed in a relative path.
What I want to do is to store some image file x at run time of the portlet, then create an html file that display that image, inside this html file i have some tag like img src="..../x", how do I achieve this?
thanks a lot!!!
Scott A. Roehrig

2004-01-19, 2:57 pm

Try dumping it into a subdir of the deployed wps.ear something like /images

You can then reference it via /wps/images/image.jpeg etc...

Scott

<wo_shi_ni_ba_ba@yahoo.com> wrote in message
news:1455498599.1059513385894.JavaMail.wasadmin@swg3ws006...
quote:

> is there a place on portal where I can store an image so that my portlet


can access it? I can not put in under the portlet hierachy in development
time. I need some other storage for the image and it can be accessed in a
relative path.
quote:

> What I want to do is to store some image file x at run time of the


portlet, then create an html file that display that image, inside this html
file i have some tag like img src="..../x", how do I achieve this?
quote:

> thanks a lot!!!




Michael Harris

2004-01-19, 2:57 pm

This depends upon what you are trying to do and when the graphic file is
created...

If the file is static and created at the time you build your portlet, just
include it in the .war file.

If the file is dynamically generated at runtime, you have 2 options:

1. Generate the graphic in a known directory on the server and then
configure your HTTP server for an alias mapping to that folder. NOTE: If
you do this, you may have security issues to deal with if the graphics
contain sensitive information that noone else needs to see.

2. Write a servlet that you deploy with your .war file. The servlet can
serve up the bytes of the graphic to the browser dynamically. You might not
even need to write the bytes of the graphic to the server's filesystem.


<wo_shi_ni_ba_ba@yahoo.com> wrote in message
news:1455498599.1059513385894.JavaMail.wasadmin@swg3ws006...
quote:

> is there a place on portal where I can store an image so that my portlet


can access it? I can not put in under the portlet hierachy in development
time. I need some other storage for the image and it can be accessed in a
relative path.
quote:

> What I want to do is to store some image file x at run time of the


portlet, then create an html file that display that image, inside this html
file i have some tag like img src="..../x", how do I achieve this?
quote:

> thanks a lot!!!




ksabharw

2004-01-19, 2:57 pm

Michael,

Can option 2 be extended to provide file attachment
function while sending web based email?

Could you point to any example/website/code for option 2.

Kapil Sabharwal


eessig1

2004-02-23, 4:34 am

> This depends upon what you are trying to do and when
> the graphic file is
> created...
>
> If the file is static and created at the time you
> build your portlet, just
> include it in the .war file.


Just to expand a little more on option one -
you will want to use the portletAPI - encodeURL.
Then you can place the image in your war file directory.
I placed mine in Web Content/images/image.jpg

Reference that in the jsp file by:

<img src='<%=portletResponse.encodeURL("images/image.jpg")%>' width="700" height="403" alt="my image" border="0"/>

good luck
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com