File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Struts 2.2 jasper HTML format image issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2.2 jasper HTML format image issue" Watch "Struts 2.2 jasper HTML format image issue" New topic
Author

Struts 2.2 jasper HTML format image issue

V. Oliver Smith
Greenhorn

Joined: Nov 15, 2011
Posts: 11
I am using Struts 2.2.3 and I'm trying to add a display type of HTML. Here is the relevant code:

struts.xml

<result name="html" type="jasper">
<param name="location">/reports/${jasperRpt}</param>
<param name="dataSource">jasperRptData</param>
<param name="format">HTML</param>
<param name="reportParameters">jasperRptParams</param>
<param name="imageServletUrl">/servlets/image?image=</param>
</result>

web.xml

<servlet>
<servlet-name>ImageServlet</servlet-name>
<servlet-class>net.sf.jasperreports.j2ee.servlets.ImageServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ImageServlet</servlet-name>
<url-pattern>/servlets/image</url-pattern>
</servlet-mapping>

All of my .gifs are in /image. Unfortunately, when I attempt to run the report, no image is displayed correctly. All I see are the red X's indicating an image could not be found

Any clues as to what the problem is?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts 2.2 jasper HTML format image issue
 
Similar Threads
jasper reports html format not displayed inspite of doing all the changes mentioned in similar post
Jasper reports generating html files
Mistakenly changed web.xml
after migrate from 4.0.1 to 4.2.0, cannot load web.xml in .war/WEB-INF
How to embed jasper report in jsp page when using struts2-jasperreports-plugin