Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • 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.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic