下面列出了怎么用org.springframework.web.servlet.view.velocity.VelocityView的API类实例代码及写法,或者点击链接到github查看源代码。
@Override
protected void initApplicationContext() {
if (this.toolboxConfigLocation != null) {
if (VelocityView.class.equals(getViewClass())) {
this.logger.info("Using EmbeddedVelocityToolboxView instead of "
+ "default VelocityView due to specified toolboxConfigLocation");
setViewClass(EmbeddedVelocityToolboxView.class);
}
}
super.initApplicationContext();
}
@Test(expected = IllegalArgumentException.class)
public void setIncorrectViewClass() {
// Should not be able to set view class to a class that does not extend
// AbstractJasperReportsView.
new JasperReportsViewResolver().setViewClass(VelocityView.class);
}