i use spring 3.0, in a jsp, i try to display data and a chart...
@Controller
@RequestMapping("/user.htm")
public class UserController {
@Autowired
private IUserService userService;
@RequestMapping(method = RequestMethod.GET)
public ModelAndView user(HttpServletRequest request,
HttpServletResponse response) {
ModelAndView modelAndView = new ModelAndView("user");
modelAndView.addObject("statUser", userService.getStatUser());
return modelAndView;
}
public void generateChart(HttpServletRequest request,
HttpServletResponse response){
try {
AxisChart axisChart = userService.generateChart();
ServletEncoderHelper.encodeJPEG13( axisChart, 1.0f, response );
} catch (ChartDataException ex) {
} catch (PropertyException ex) {
} catch (IOException ex) {
}
}
}
in the jsp i try to display the chart with
<img src="generateChart"/>
i can see the information... so the get of the controller work fine, but the image is never displayed
so i don't know if i can use the same controller or need to create a new one only for creation of the image...
any idea?