title: Embedding jpg within Liferay Portlet
body: <p>I am using Liferay portlets, having an issue embedding jpg images within a view.jsp page.</p>
  
  <p>My directory structure appears as follows:</p>
  
  <pre><code>webapp
  ---myportlet
  ------view.jsp
  ------myimage.jpg
  </code></pre>
  
  <p>Within my view.jsp page, I have the following:</p>
  
  <pre><code>&lt;img src="&lt;%=request.getContextPath()%&gt;/myimage.jpg" /&gt;
  </code></pre>
  
  <p>The above image path resolves to the following:</p>
  
  <pre><code>path = /myportlet/myimage.jpg
  </code></pre>
  
  <p>Within my portlet.xml file, I have the following:</p>
  
  <pre><code>&lt;supports&gt;
      &lt;mime-type&gt;image/jpeg&lt;/mime-type&gt;
      &lt;portlet-mode&gt;view&lt;/portlet-mode&gt;
  &lt;/supports&gt;
  </code></pre>
  
  <p>I understand one solution is to put all images within the underlying web/app server and reference that path.  But it is strongly preferred to put these images within the portlet directory.</p>
  
  <p>With that said, some questions:</p>
  
  <ol>
  <li>Is it possible to put images within the portlet directory with Liferay</li>
  <li>Do I need to make further modifications to portlet.xml or liferay-portlet.xml files?</li>
  <li>Is there a better way to reference image file paths within portlet directories</li>
  <li>Other ideas?</li>
  </ol>