• Post Reply Bookmark Topic Watch Topic
  • New Topic

Images/CSS/JS Portlets Websphere

 
Ray Carrender
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there anyway to give a portlet a local CSS file or import an image? Typically this would be handled by the theme; but say I want to just package up a portlet and share it between different portals this would be difficult.

I've tried simple things like <img src="images/image.jpg"/> and <img src="/web-inf/jsps/images/image.jpg"/> (I've also tried tons of variation on this).

Any ideas?!

Thanks
--Ray
 
Robert zi
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ray,

i was strugling with the same problem. In the exceptions you can see that only full paths are supported.
so you have to get the full path

and append your path '/theme/images/myimage.png'
secondly do not place your files in the web-inf tree

hope this wil help you out

regards
robert
 
Sachin Telang
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Robert is absolutely correct. For example if you want to refer any image below is the example



'<%=renderResponse.encodeURL(renderRequest.getContextPath() + "/Home1_files/logo_scale.gif")%>' in img tag.

 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!