title: java - spring mvc @RequestMapping produces multiple formats
body: <p>I'm working on a java spring mvc application. I have a method in my controller that responsible for producing image:</p>
  
  <pre><code> @RequestMapping(value = "/view", method = RequestMethod.GET, produces = "image/jpg")
  public void viewImage(HttpServletResponse response, HttpServletRequest request) throws Exception
  </code></pre>
  
  <p>This works fine. But I have a problem now. The produced images may have 3 formats jpg, jpeg and png. Therefore I need several <code>produces</code> attribute in the <code>@RequestMapping</code>. Is there any way to do this? For example, something like this: <code>produces = "image/jpg, image/jpeg, image/png"</code></p>