code: @RequestMapping(value = "/legendgraphic", method = RequestMethod.GET)
  	public ModelAndView getGraphic(@RequestParam("layerId") String layerId,
  			@RequestParam(value = "styleName", required = false) String styleName,
  			@RequestParam(value = "ruleIndex", required = false) Integer ruleIndex,
  			@RequestParam(value = "format", required = false) String format,
  			@RequestParam(value = "width", required = false) Integer width,
  			@RequestParam(value = "height", required = false) Integer height,
  			@RequestParam(value = "scale", required = false) Double scale,
  			@RequestParam(value = "allRules", required = false) Boolean allRules, HttpServletRequest request)
  			throws GeomajasException {
  		if (!allRules) {
  			return getGraphic(layerId, styleName, ruleIndex, format, width, height, scale);
  		} else {
  			return getGraphics(layerId, styleName, format, width, height, scale);
  		}
  	}
docs: Gets a legend graphic with the specified metadata parameters. All parameters are passed as request parameters.
  
  @param layerId
  the layer id
  @param styleName
  the style name
  @param ruleIndex
  the rule index
  @param format
  the image format ('png','jpg','gif')
  @param width
  the graphic's width
  @param height
  the graphic's height
  @param scale
  the scale denominator (not supported yet)
  @param allRules
  if true the image will contain all rules stacked vertically
  @param request
  the servlet request object
  @return the model and view
  @throws GeomajasException
  when a style or rule does not exist or is not renderable