Skip to content

Instantly share code, notes, and snippets.

@oak-tree
Created March 13, 2014 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oak-tree/9530666 to your computer and use it in GitHub Desktop.
Save oak-tree/9530666 to your computer and use it in GitHub Desktop.
/* this WORKS */
@RequestMapping(value = "{field}/image/{name}.jpg", method = RequestMethod.GET)
public void getImage(HttpServletResponse response, @PathVariable("field") String field,@PathVariable("name") String name)
throws NoSuchImageException, BadFieldNameException, IOException, PathTraversalException {
model.uploadMagdirImageFile(MagdirPrecondition.fieldNameOk(field),name, response);
}
/*
this does NOT work
*/
@RequestMapping(value = "{field}/icon/{column}/{name}.jpg", method = RequestMethod.GET)
public void getIcon(HttpServletResponse response, @PathVariable("field") String field,@PathVariable("column") String column,@PathVariable("name") String name)
throws NoSuchImageException, BadFieldNameException, IOException, PathTraversalException {
model.uploadMagdirIconAnswer(MagdirPrecondition.fieldNameOk(field),column ,name, response);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment