title: Displaying the images in html report using ireport
body: <p>I was trying for long, am create report using iReport designer. In that its showing the images in all format(PDF,Excel,RTF). but while am trying to display in html format, the image is not displaying. What i want to do to solve dis problem. Am trying dis for long time. could anyone help me.
  The following is the code i am using in my controller class for images in html report.</p>
  
  <pre><code> String image = request.getSession().getServletContext().getRealPath("/"); 
  Map parameterMap = new HashMap();
  
  
   parameterMap.put("datasource", JRdataSource);
          parameterMap.put("Image1",image);
          parameterMap.put("Image2",image);
          parameterMap.put(JRExporterParameter.CHARACTER_ENCODING, "UTF8");
          parameterMap.put(JRHtmlExporterParameter.IMAGES_URI, "../report/image?image=");
          parameterMap.put(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, Boolean.FALSE);
   //htmlReport bean has ben declared in the jasper-views.xml file
          modelAndView = new ModelAndView("htmlReport", parameterMap);
  
          return modelAndView;
  </code></pre>
  
  <p>The below is my jrxml code.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="testreport2" language="java" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"&gt;
      &lt;property name="ireport.zoom" value="1.0"/&gt;
      &lt;property name="ireport.x" value="0"/&gt;
      &lt;property name="ireport.y" value="0"/&gt;
      &lt;parameter name="Image1" class="java.lang.String"/&gt;
      &lt;parameter name="Image2" class="java.lang.String"/&gt;
      &lt;field name="activePackage" class="java.lang.String"/&gt;
      &lt;background&gt;
          &lt;band splitType="Stretch"/&gt;
      &lt;/background&gt;
      &lt;title&gt;
          &lt;band height="60" splitType="Stretch"&gt;
              &lt;staticText&gt;
                  &lt;reportElement mode="Opaque" x="0" y="0" width="555" height="56"/&gt;
                  &lt;textElement/&gt;
                  &lt;text&gt;&lt;![CDATA[]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
              &lt;staticText&gt;
                  &lt;reportElement mode="Opaque" x="0" y="2" width="515" height="54" backcolor="#E6E6E6"/&gt;
                  &lt;textElement/&gt;
                  &lt;text&gt;&lt;![CDATA[]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
              &lt;image scaleImage="Clip" isUsingCache="false"&gt;
                  &lt;reportElement key="image-1" x="308" y="2" width="187" height="58"/&gt;
                  &lt;imageExpression class="net.sf.jasperreports.engine.JRRenderable"&gt;&lt;![CDATA[net.sf.jasperreports.engine.JRImageRenderer.getInstance(image-dir"/flower1.png"))]]&gt;&lt;/imageExpression&gt;
              &lt;/image&gt;
              &lt;image scaleImage="Clip" isUsingCache="false"&gt;
                  &lt;reportElement key="image-1" x="0" y="0" width="226" height="57"/&gt;
                  &lt;imageExpression class="net.sf.jasperreports.engine.JRRenderable"&gt;&lt;![CDATA[net.sf.jasperreports.engine.JRImageRenderer.getInstance(image-dir"/flower2.png"))]]&gt;&lt;/imageExpression&gt;
              &lt;/image&gt;
          &lt;/band&gt;
      &lt;/title&gt;
      &lt;pageHeader&gt;
          &lt;band height="35" splitType="Stretch"/&gt;
      &lt;/pageHeader&gt;
      &lt;columnHeader&gt;
          &lt;band height="61" splitType="Stretch"&gt;
              &lt;staticText&gt;
                  &lt;reportElement x="0" y="0" width="100" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;text&gt;&lt;![CDATA[activePackage]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
          &lt;/band&gt;
      &lt;/columnHeader&gt;
      &lt;detail&gt;
          &lt;band height="39" splitType="Stretch"&gt;
              &lt;textField&gt;
                  &lt;reportElement x="0" y="0" width="100" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$F{activePackage}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
          &lt;/band&gt;
      &lt;/detail&gt;
      &lt;columnFooter&gt;
          &lt;band height="45" splitType="Stretch"/&gt;
      &lt;/columnFooter&gt;
      &lt;pageFooter&gt;
          &lt;band height="54" splitType="Stretch"/&gt;
      &lt;/pageFooter&gt;
      &lt;summary&gt;
          &lt;band height="42" splitType="Stretch"/&gt;
      &lt;/summary&gt;
  &lt;/jasperReport&gt;
  </code></pre>
  
  <p>Here the two images are located under webapp/images.I am passing these images as the parameter from the controller class to the jrxml file.</p>
  
  <p>Images are not displaying.Anything wrong in my code.Anyhelp will be highly appreciated.</p>