在我的Spring Web MVC應用程序中,我打算在jsp視圖上顯示一些JFree圖表,我不知道如何執行此操作, 自第一個想法i沒有爲我工作,生成一個圖像,然後從文件夾中檢索它。Spring MVC和JFreeChart(在視圖中顯示圖表)
現在我想,是控制器能夠直接重畫圖像嗎? 想這是我的服務接口:
public interface ReportingService {
Image getChart() ;
}
我可以做這樣的事情,我怎麼能叫這個形象從我的jsp?
@Controller
public class ReportingController {
@Autowired
private ReportingService reportingService ;
@RequestMapping("/reports")
public Image handleReports(){
return reportingService.getChart() ;
}
}
cewolf很有趣,我只是需要一個如何在基於Spring MVC的應用程序中使用它的例子。 – elaich