I want to use images in the portlet I am creating, but can't find any examples of how best to form the URLs for this.
I initially thought that URLs should just be relative to the web-app that wraps the portlet, but these don't appear to work as I have coded them.
The web-app has the a folder called images and content image.jsp
warfile structure
portlet.war images image.jsp jsp view.jsp META-INF WEB-INF classes ImagePortlet.class portlet.xml portlet-instances.xml portlet-object.xml web.xml
<image src="images/image.jpg" />does not display. I expect that I need to do more work on the URL to achieve this. Can someone provide me with a sample, or point me to the docs where this is described because I can't locate this information.
Ok, problem solved, I've found the encodeURL method of portletResponse
API doc
http://docs.jboss.org/jbportal/spec/docs/javax/portlet/PortletResponse.html#encodeURL(java.lang.String)