1 24 package org.riotfamily.website.generic.view; 25 26 import java.util.Locale ; 27 28 import org.springframework.core.Ordered; 29 import org.springframework.web.servlet.View; 30 import org.springframework.web.servlet.ViewResolver; 31 32 45 public class DumpModelViewResolver implements ViewResolver, Ordered { 46 47 private DumpModelView dumpModelView = new DumpModelView(); 48 49 private String dumpViewName = FixedViewNameTranslator.DEFAULT_VIEW_NAME; 50 51 public int getOrder() { 52 return Ordered.HIGHEST_PRECEDENCE; 53 } 54 55 59 public void setStyleSheet(String styleSheet) { 60 dumpModelView.setStyleSheet(styleSheet); 61 } 62 63 67 public void setDumpViewName(String dumpViewName) { 68 this.dumpViewName = dumpViewName; 69 } 70 71 public View resolveViewName(String viewName, Locale locale) { 72 if (dumpViewName.equals(viewName)) { 73 return dumpModelView; 74 } 75 return null; 76 } 77 } 78 | Popular Tags |