@Bean public VelocityViewResolver viewResolver() { VelocityViewResolver viewResolver = new VelocityViewResolver(); viewResolver.setCache(true); viewResolver.setPrefix("org/n3r/quartz/glass/velocity/"); viewResolver.setSuffix(".vm"); viewResolver.setContentType("text/html;charset=UTF-8"); return viewResolver; }
public VelocityViewResolver() { setViewClass(requiredViewClass()); }
@Bean public ViewResolver viewResolver() { VelocityViewResolver bean = new VelocityViewResolver(); bean.setCache(true); bean.setPrefix("/"); bean.setSuffix(".vm"); bean.setRequestContextAttribute("request"); return bean; }
@Bean VelocityViewResolver velocityViewResolver() { VelocityViewResolver resolver = new VelocityViewResolver(); resolver.setSuffix(this.environment.getProperty("suffix", ".vm")); resolver.setPrefix(this.environment.getProperty("prefix", "/public/")); // Needs to come before any fallback resolver (e.g. a // InternalResourceViewResolver) resolver.setOrder(Ordered.LOWEST_PRECEDENCE - 20); Properties p = new Properties(); p.put(Velocity.FILE_RESOURCE_LOADER_PATH, "/public/"); p.put("input.encoding", "utf-8"); p.put("output.encoding", "utf-8"); resolver.setAttributes(p); resolver.setContentType("text/html;charset=utf-8"); return resolver; } }
VelocityViewResolver resolver = new VelocityViewResolver(); resolver.setViewClass(VelocityToolboxView.class); resolver.setPrefix(""); resolver.setSuffix(".vm"); return resolver;
@Override protected void initApplicationContext() { super.initApplicationContext(); if (this.toolboxConfigLocation != null) { if (VelocityView.class == getViewClass()) { logger.info("Using VelocityToolboxView instead of default VelocityView " + "due to specified toolboxConfigLocation"); setViewClass(VelocityToolboxView.class); } else if (!VelocityToolboxView.class.isAssignableFrom(getViewClass())) { throw new IllegalArgumentException( "Given view class [" + getViewClass().getName() + "] is not of type [" + VelocityToolboxView.class.getName() + "], which it needs to be in case of a specified toolboxConfigLocation"); } } }
@Override protected AbstractUrlBasedView buildView(String viewName) throws Exception { VelocityLayoutView view = (VelocityLayoutView) super.buildView(viewName); // Use not-null checks to preserve VelocityLayoutView's defaults. if (this.layoutUrl != null) { view.setLayoutUrl(this.layoutUrl); } if (this.layoutKey != null) { view.setLayoutKey(this.layoutKey); } if (this.screenContentKey != null) { view.setScreenContentKey(this.screenContentKey); } return view; }
@Override protected void initApplicationContext() { super.initApplicationContext(); if (this.toolboxConfigLocation != null) { if (VelocityView.class == getViewClass()) { logger.info("Using VelocityToolboxView instead of default VelocityView " + "due to specified toolboxConfigLocation"); setViewClass(VelocityToolboxView.class); } else if (!VelocityToolboxView.class.isAssignableFrom(getViewClass())) { throw new IllegalArgumentException( "Given view class [" + getViewClass().getName() + "] is not of type [" + VelocityToolboxView.class.getName() + "], which it needs to be in case of a specified toolboxConfigLocation"); } } }
@Override protected AbstractUrlBasedView buildView(String viewName) throws Exception { VelocityLayoutView view = (VelocityLayoutView) super.buildView(viewName); // Use not-null checks to preserve VelocityLayoutView's defaults. if (this.layoutUrl != null) { view.setLayoutUrl(this.layoutUrl); } if (this.layoutKey != null) { view.setLayoutKey(this.layoutKey); } if (this.screenContentKey != null) { view.setScreenContentKey(this.screenContentKey); } return view; }
public VelocityViewResolver() { setViewClass(requiredViewClass()); }
@Override protected void initApplicationContext() { super.initApplicationContext(); if (this.toolboxConfigLocation != null) { if (VelocityView.class == getViewClass()) { logger.info("Using VelocityToolboxView instead of default VelocityView " + "due to specified toolboxConfigLocation"); setViewClass(VelocityToolboxView.class); } else if (!VelocityToolboxView.class.isAssignableFrom(getViewClass())) { throw new IllegalArgumentException( "Given view class [" + getViewClass().getName() + "] is not of type [" + VelocityToolboxView.class.getName() + "], which it needs to be in case of a specified toolboxConfigLocation"); } } }
@Override protected AbstractUrlBasedView buildView(String viewName) throws Exception { VelocityLayoutView view = (VelocityLayoutView) super.buildView(viewName); // Use not-null checks to preserve VelocityLayoutView's defaults. if (this.layoutUrl != null) { view.setLayoutUrl(this.layoutUrl); } if (this.layoutKey != null) { view.setLayoutKey(this.layoutKey); } if (this.screenContentKey != null) { view.setScreenContentKey(this.screenContentKey); } return view; }
public VelocityViewResolver() { setViewClass(requiredViewClass()); }