This week's book giveaway is in the Open Source forum.
We're giving away four copies of Programmers Guide to Apache Thrift and have Randy Abernethy on-line!
See this thread for details.
Win a copy of Programmers Guide to Apache Thrift this week in the Open Source forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Images/CSS/JS Portlets Websphere  RSS feed

 
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
 
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
 
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
Boost this thread!