gstafford Posted January 15, 2013 Share Posted January 15, 2013 Hello,I've created a portlet using Liferay. I believe I have this set correctly but I can not get the images to display. I'm new to Java so I'm trying to determine the best way to debug this. My code is here: JRHtmlExporter exporter = new JRHtmlExporter(); request.getPortletSession().setAttribute( ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE, printObject); exporter.setParameter(JRExporterParameter.JASPER_PRINT, printObject); exporter.setParameter(JRExporterParameter.OUTPUT_STRING_BUFFER, outputBuffer); exporter.setParameter(JRHtmlExporterParameter.IMAGES_MAP, new HashMap()); exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, "../servlets/image?image="); exporter.setParameter(JRHtmlExporterParameter.IS_WHITE_PAGE_BACKGROUND, java.lang.Boolean.FALSE); exporter.setParameter(JRHtmlExporterParameter.IGNORE_PAGE_MARGINS, java.lang.Boolean.TRUE); exporter.exportReport(); And I have this code in my web.xml ImageServlet net.sf.jasperreports.j2ee.servlets.ImageServlet ImageServlet /servlets/image Everywhere I read makes me believe I have this right, but I am getting nothing in the HTML version. The PDF and XLS versions of the reports all show the graphics and graphs. Any clues on how to debug this or troubleshoot this and track it down? Thanks,George Link to comment Share on other sites More sharing options...
sanbez Posted January 15, 2013 Share Posted January 15, 2013 ImageServlet /imagerequest.getSession().setAttribute(ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE, jasperPrint);exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, "image?image=");see for example http://community.jaspersoft.com/questions/801752/html-export-image-impossible Link to comment Share on other sites More sharing options...
gstafford Posted January 17, 2013 Author Share Posted January 17, 2013 So I made the adjustments you recommended - I apologize for taking so long, busy week. When I do this the code in the browser renders as http://xxxxxxx/group/guest/image?image=px which returns a 404. I've adjusted the link several different ways including http://xxxxxx/image?image=px and I get a 404 with all of them. Any other thoughts? Link to comment Share on other sites More sharing options...
amywhite989 Posted April 8, 2014 Share Posted April 8, 2014 I am not sure I get your image displaying issue in the right way, but I think you can read this blog, most of it talking about the imaging issue in liferay.http://community.jaspersoft.com/sites/all/libraries/ckeditor/plugins/smiley/images/regular_smile.gifhttp://longgoldenears.blogspot.de/2008/03/portaldelegateservlet-servlet-session.html Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now