title: Generate image and display it inside JSP along with other content
body: <p>I'm using JFreeChart to generate a dynamic chart depending on the user input. I have a JSP with some textbox and combobox, the user makes the input and submits it, and the Action process it, generating an image of a chart. I need to display this image on the same JSP as before, below the textbox/combobox.</p>
  
  <p>If I use <code>response.setContentType("image/jpeg");</code> etc... then I get a page with the image alone. I thought of saving the image to a file and then access it with  <code>&lt;img &gt;</code>, but I'm not sure that will work (need to save it to WebContent and I may not be able to access it always?).</p>
  
  <p>Is there a way to somehow cache the image and then access it inside the JSP through an <code>&lt;img&gt;</code> or something? Maybe JFreeChart has an easy way to do what I want?</p>
  
  <p>If it matters, I'm also using struts and spring on my webapp.</p>
  
  <p>Thanks in advance.</p>