VelocityRenderTests.java 文件源码

java
阅读 19 收藏 0 点赞 0 评论 0

项目:spring4-understanding 作者:
@Before
public void setUp() throws Exception {
    wac = new StaticWebApplicationContext();
    wac.setServletContext(new MockServletContext());

    final Template expectedTemplate = new Template();
    VelocityConfig vc = new VelocityConfig() {
        @Override
        public VelocityEngine getVelocityEngine() {
            return new TestVelocityEngine("test.vm", expectedTemplate);
        }
    };
    wac.getDefaultListableBeanFactory().registerSingleton("velocityConfigurer", vc);
    wac.refresh();

    request = new MockHttpServletRequest();
    request.setAttribute(DispatcherServlet.WEB_APPLICATION_CONTEXT_ATTRIBUTE, wac);
    request.setAttribute(DispatcherServlet.LOCALE_RESOLVER_ATTRIBUTE, new AcceptHeaderLocaleResolver());
    request.setAttribute(DispatcherServlet.THEME_RESOLVER_ATTRIBUTE, new FixedThemeResolver());
    response = new MockHttpServletResponse();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号