Cross utilize static contents across portal packages

hi All,

I have 2 portlet packages (Lets say PackageA and PackageB) deployed to MWS server.

I want to reuse some static contents (images, .js files) present in PackageA - in the portlets of Package B.

I am trying to use imageA.jpg present in Package A in the portlets of Package B by giving relative path …/PackageA/imageA.jpg
If I run portlet present in Package B - in the logs it is giving error ‘request content not found: /PackageA/imageA.jpg’

  1. I can see Package A and Package B are present in /MWS/server/default/deploy folder at same hierarchy level. Hence I am expecting the relative path i to go 1 folder back from PackageB, step into PackageA, get imageA.jpg and display it in portlet present in PackageB. But it is giving above error.

Do you have any inputs why I am not able to cross utilize static contents across portal packages?

Kind regards,
Raja sekhar Kintali

The image path would be relative to the current URL you are rendering. For a portlet the current URL probably isn’t known beforehand so it is probably not practical to hardcode a relative path.

Try setting your image control value to something like this: fe:/PackageA/imageA.jpg

The “fe:” prefix on the value will resolve the image path relative to the MWS front end url.

hi Eric,

Thanks for your response.

I put these images in a location relative to front end url and able to access images. Thank you for your inputs.

Facing another problem in utilizing classes present in a jar file - from with in a jsp page which is present relative to the front end url.

Could you please advice if you have any idea on this?

Kind regards,
Raja sekhar Kintali