Hi,
I have in macro class this code:
ChartUtilities.saveChartAsPNG(new File("myChart.png"), chart, 1000, 500, null, true, 0);
String chartImageName = chart.createChart();
context.put("chartImageName", chartImageName);
return VelocityUtils.getRenderedTemplate("template/chart_report_show.vm", context);
I dont know how I can access in Velocity Template to generated image show on web page.
Thanks for answers.
Community moderators have prevented the ability to post new answers.
Only second mentioned solution is available in my project, but how I get image file from memory in created servlet? I dont find any possible way how i can get it from request...
Depending on your user's target browser I could imagine the following two solutions:
1) Embed the image Base64 encoded in your HTML
e.g. <img alt="Your Chart" src="data:image/png;base64,sdafdsff23f..." />
Supported browsers - Wikipedia says:
Data URIs are currently supported by the following web browsers:
2) Create a parameterized servlet plugin to deliver your image
How to achieve this is documented in Atlassian's documentation: http://confluence.atlassian.com/display/CONFDEV/Servlet+Module
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.