1 16 17 package org.springframework.web.servlet.view.jasperreports; 18 19 import java.util.Map ; 20 import java.util.Properties ; 21 22 25 public class JasperReportsMultiFormatViewWithCustomMappingsTests extends JasperReportsMultiFormatViewTests { 26 27 protected AbstractJasperReportsView getViewImplementation() { 28 JasperReportsMultiFormatView view = new JasperReportsMultiFormatView(); 29 view.setFormatKey("fmt"); 30 31 Properties props = new Properties (); 32 props.setProperty("csv", JasperReportsCsvView.class.getName()); 33 props.setProperty("comma-separated", JasperReportsCsvView.class.getName()); 34 props.setProperty("html", JasperReportsHtmlView.class.getName()); 35 36 view.setFormatMappings(props); 37 return view; 38 } 39 40 protected String getDiscriminatorKey() { 41 return "fmt"; 42 } 43 44 protected void extendModel(Map model) { 45 model.put(getDiscriminatorKey(), "comma-separated"); 46 } 47 48 } 49 | Popular Tags |