1 Reply Latest reply on Mar 23, 2009 9:13 AM by apemberton

    Where to put images ?

    hemus7

      Hi,
      I am new to portal development.
      While packaging portlet an jsp's as war files I am putting
      images required in a folder "images" and
      calling it as
      img src="/images/iconCalendar.gif".
      While deployed in portal its not taking the image I put within the war file.
      Please help in resolving this issue,also css path too

        • 1. Re: Where to put images ?

          When it comes to packaging images, css, and other static resources for portal development, you basically have two choices: a) package the resources inside your portlet WAR or b) package the resources inside your theme.

          It looks like you want to use option a above and the problem you're having is that you're not referencing the context path of your portlet to retrieve the resources you've placed there. Using your example, you'd want to reference:

          <img src="${renderRequest.contextPath}/images/iconCalendar.gif" />


          Option b, placing resources in your theme, may make better sense in your scenario; it should be used when the resources you need to access may be used across portlets. I typically place all CSS inside my theme, to promote reuse of styles.

          Good luck!