title: Can anyone please tell me how to integrate Jasper Report with Struts2 and Hibernate?
body: <p>I've created a web application using struts2 and hibernate framework.
  In my application i planned to use jasper report for reporting, which i used commonly in desktop application for reporting.
  In desktop application calling a jasper report is quiet very easy.But in the same way in web application with struts2 and hibernate framework i don't know how to call a jasper report in jsp.
  can anyone please tell me how to integrate jasper report in web apps that use struts2 and hibernate framework </p>
  
  <p>here is my source code what i've done so far</p>
  
  <p><strong>Sample.jasper</strong> which resides in a default folder with struts.xml and hibernate.conf.xml (its all working in preview mode)</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="report name" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="a309cf26-d77c-4e85-8d52-2a89cff70117"&gt;
      &lt;property name="ireport.zoom" value="1.0"/&gt;
      &lt;property name="ireport.x" value="0"/&gt;
      &lt;property name="ireport.y" value="43"/&gt;
      &lt;queryString language="hql"&gt;
          &lt;![CDATA[FROM Login]]&gt;
      &lt;/queryString&gt;
      &lt;field name="id" class="java.lang.Integer"/&gt;
      &lt;field name="name" class="java.lang.String"/&gt;
      &lt;field name="pass" class="java.lang.String"/&gt;
      &lt;background&gt;
          &lt;band splitType="Stretch"/&gt;
      &lt;/background&gt;
      &lt;title&gt;
          &lt;band height="79" splitType="Stretch"/&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 uuid="5eaebc5a-8cc1-45dd-9596-c4057ea97aed" x="118" y="41" width="100" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;text&gt;&lt;![CDATA[NAME]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
              &lt;staticText&gt;
                  &lt;reportElement uuid="5eaebc5a-8cc1-45dd-9596-c4057ea97aed" x="271" y="41" width="100" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;text&gt;&lt;![CDATA[PASSWORD]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
          &lt;/band&gt;
      &lt;/columnHeader&gt;
      &lt;detail&gt;
          &lt;band height="30" splitType="Stretch"&gt;
              &lt;textField&gt;
                  &lt;reportElement uuid="07e4ccc0-6491-4a87-b03b-bed972fb344d" x="118" y="4" width="100" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$F{name}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField&gt;
                  &lt;reportElement uuid="07e4ccc0-6491-4a87-b03b-bed972fb344d" x="271" y="4" width="100" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$F{pass}]]&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><strong>struts.xml</strong> (i don't know how to call the jasper from action)</p>
  
  <pre><code>&lt;!DOCTYPE struts PUBLIC
  "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
  "http://struts.apache.org/dtds/struts-2.0.dtd"&gt;
  
  &lt;struts&gt;
      &lt;!-- Configuration for the default package. --&gt;
     &lt;package name="default" extends="struts-default"&gt;
  
      &lt;/package&gt;
  &lt;/struts&gt;
  </code></pre>