I'm working on Spring WebFlow / JSF web-app. I need to develop administration panel where admin can upload some files and build page content using this files as fragments. I hope I described it well. To do that, I've created Spring MVC controller with mapping like below. It output files from database (images, .xhtml). How to use that controller to include files on page source ?
@RequestMapping("/file")
public void getFileContent(@RequestParam("id") Integer id, HttpServletResponse response) throws IOException {
File f = fileDAO.get(id);
response.setContentType(f.getMime());
IOUtils.write(f.getData(), response.getOutputStream());
}
This doesn't work:
<ui:include src="#{request.contextPath}/app/file?id=6" />