1 Reply Latest reply on Jul 20, 2006 8:35 AM by free1000

    Best practice for resource URLs

    free1000

      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


      In view.jsp I want to insert an image tag which displays images/image.jsp

      <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.