title: Image expression URL in Jasper Reports
body: <p>I would like to embed an image into my JasperReports jrxml file. I have this directory structure.</p>
  
  <pre><code>Tomcat Root
   webapps
    reports
     --&gt;images
      --&gt; company_logo.jpg
     --&gt;reports
      --&gt;sample.jasper
     --&gt;WEB-INF
      --&gt;classes
  </code></pre>
  
  <p>And I tried doing this thinking that this is relative to my reports context root</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;image&gt;
   &lt;reportElement x="0" y="0" width="104" height="40"/&gt;
   &lt;imageExpression class="java.lang.String"&gt;
    &lt;![CDATA["images/company_logo.jpg"]]&gt;
   &lt;/imageExpression&gt;
  &lt;/image&gt;
  </code></pre>
  
  <p>..and this also</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;image&gt;
   &lt;reportElement x="0" y="0" width="104" height="40"/&gt;
   &lt;imageExpression class="java.lang.String"&gt;
    &lt;![CDATA["/images/company_logo.jpg"]]&gt;
   &lt;/imageExpression&gt;
  &lt;/image&gt;
  </code></pre>
  
  <p>but it always says there was an error loading bytes from location <code>JRLoader</code>.</p>
  
  <p>I tried doing this and it works, but I am a bit confused why my first two attempt doesn't.</p>
  
  <p>Is this really how you embed images in JasperReports? Do you need to supply the whole path?  I am thinking that there should be a page relative
  something.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;image&gt;
   &lt;reportElement x="0" y="0" width="104" height="40"/&gt;
   &lt;imageExpression class="java.lang.String"&gt;
    &lt;![CDATA["http://localhost:8080/reports/images/company_logo.jpg"]]&gt;
   &lt;/imageExpression&gt;
  &lt;/image&gt;
  </code></pre>
  
  <p>I am a bit puzzled about the correct way.</p>