andrei_3 Posted September 5, 2014 Share Posted September 5, 2014 In my application data for report coming from REST service. Report contain 1 image( logo), table with data and timeaxis chart for table visualization.When I sent 1-st request in response I ve got 1 POST and 2 GET for image. Like that:127.0.0.1 - - [05/Sep/2014:12:30:40 +0300] "POST /report/tripDynamic/HTML HTTP/1.1" 200 13161127.0.0.1 - - [05/Sep/2014:12:30:40 +0300] "GET /image?image=img_0_0_1 HTTP/1.1" 200 32296127.0.0.1 - - [05/Sep/2014:12:30:40 +0300] "GET /image?image=img_0_0_8 HTTP/1.1" 200 13213 then I change one parameter in web form (month) and try to get new report, application sends only one POST request127.0.0.1 - - [05/Sep/2014:12:31:13 +0300] "POST /report/tripDynamic/HTML HTTP/1.1" 200 13161data in output table changed according request , but chart is old, from first report. How to force image request!!!? Tags for chart: <image scaleImage="RealSize" hAlign="Center" vAlign="Middle"> <reportElement mode="Opaque" x="0" y="0" width="505" height="270" uuid="2efe2e09-2042-4832-8f8d-0dcb7780bfec"/> <imageExpression><![CDATA[$P{chartUtils}.createLineChart($F{trips}, $F{violations}, $F{coefficients}, $F{titles}, $F{dates}, $F{range}, $F{type})]]></imageExpression> </image> Link to comment Share on other sites More sharing options...
Solution andrei_3 Posted September 9, 2014 Author Solution Share Posted September 9, 2014 Problem solved by adding one more identificator.To capture image by servlet was proposed add to handle image path like exporterOutput = new SimpleHtmlExporterOutput(response.getOutputStream()); exporterOutput.setImageHandler(new WebHtmlResourceHandler("image?image={0}")); exporterHTML.setExporterOutput(exporterOutput);[/code]we just change it a little: exporterOutput.setImageHandler(new WebHtmlResourceHandler( "image?" + ImageServlet.IMAGE_NAME_REQUEST_PARAMETER + "={0}" + "&uuid=" + UUID.randomUUID().toString())); 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