@Test public void process_shouldSetCustomModelProperties() throws Exception { MockHttpSession httpSession = new MockHttpSession(); Session session = new Session(httpSession); String result = factory.handle(new PageRequest("somemodule", "groovy", new MockHttpServletRequest(), new MockHttpServletResponse(), session)); assertThat(result, new Contains("Testing Success!!!")); }
public String handle(PageRequest request) throws PageAction { long startTime = System.currentTimeMillis(); PageContext context = new PageContext(request); context.setMessageSource(messageSource); context.setPageFactory(this); context.setFragmentFactory(fragmentFactory); context.setExtensionManager(extensionManager); overridePageProviderAndName(request); if (modelConfigurators != null) { for (PageModelConfigurator pageModelConfigurator : modelConfigurators) { pageModelConfigurator.configureModel(context); } } String result = process(context); if (log.isDebugEnabled()) { log.debug(">>> Page >>> handled " + request + " in " + (System.currentTimeMillis() - startTime) + " ms"); } request.getResponse().setHeader("Cache-Control", "no-cache,no-store,must-revalidate"); request.getResponse().setHeader("Pragma", "no-cache"); request.getResponse().setDateHeader("Expires", 0); return result; }
PageFactory { public String handle(PageRequest request) throws PageAction { long startTime = System.currentTimeMillis(); PageContext context = new PageContext(request); context.setMessageSource(messageSource); context.setPageFactory(this); context.setFragmentFactory(fragmentFactory); context.setExtensionManager(extensionManager); overridePageProviderAndName(request); if (modelConfigurators != null) { for (PageModelConfigurator pageModelConfigurator : modelConfigurators) { pageModelConfigurator.configureModel(context); } } String result = process(context); if (log.isDebugEnabled()) { log.debug(">>> Page >>> handled " + request + " in " + (System.currentTimeMillis() - startTime) + " ms"); } request.getResponse().setHeader("Cache-Control", "no-cache,no-store,must-revalidate"); request.getResponse().setHeader("Pragma", "no-cache"); request.getResponse().setDateHeader("Expires", 0); return result; } }
PageFactory { public String handle(PageRequest request) throws PageAction { long startTime = System.currentTimeMillis(); PageContext context = new PageContext(request); context.setMessageSource(messageSource); context.setPageFactory(this); context.setFragmentFactory(fragmentFactory); context.setExtensionManager(extensionManager); overridePageProviderAndName(request); if (modelConfigurators != null) { for (PageModelConfigurator pageModelConfigurator : modelConfigurators) { pageModelConfigurator.configureModel(context); } } String result = process(context); if (log.isDebugEnabled()) { log.debug(">>> Page >>> handled " + request + " in " + (System.currentTimeMillis() - startTime) + " ms"); } request.getResponse().setHeader("Cache-Control", "no-cache,no-store,must-revalidate"); request.getResponse().setHeader("Pragma", "no-cache"); request.getResponse().setDateHeader("Expires", 0); return result; }  }
PageFactory { public String handle(PageRequest request) throws PageAction { long startTime = System.currentTimeMillis(); PageContext context = new PageContext(request); context.setMessageSource(messageSource); context.setPageFactory(this); context.setFragmentFactory(fragmentFactory); context.setExtensionManager(extensionManager); overridePageProviderAndName(request); if (modelConfigurators != null) { for (PageModelConfigurator pageModelConfigurator : modelConfigurators) { pageModelConfigurator.configureModel(context); } } String result = process(context); if (log.isDebugEnabled()) { log.debug(">>> Page >>> handled " + request + " in " + (System.currentTimeMillis() - startTime) + " ms"); } request.getResponse().setHeader("Cache-Control", "no-cache,no-store,must-revalidate"); request.getResponse().setHeader("Pragma", "no-cache"); request.getResponse().setDateHeader("Expires", 0); return result; }  String handle(PageRequest request); String process(PageContext context); Map<String, PageControllerProvider> getControllerProviders(); void setControllerProviders(Map<String, PageControllerProvider> newControllerProviders); void setAdditionalControllerProviders(Map<String, PageControllerProvider> additional); void addControllerProvider(String key, PageControllerProvider provider); Map<String, PageViewProvider> getViewProviders(); void setViewProviders(Map<String, PageViewProvider> newViewProviders); void setAdditionalViewProviders(Map<String, PageViewProvider> additional); void addViewProvider(String key, PageViewProvider provider); List<PageRequestMapper> getRequestMappers(); void setRequestMappers(List<PageRequestMapper> requestMappers); ConversionService getConversionService(); List<PageModelConfigurator> getModelConfigurators(); void setModelConfigurators(List<PageModelConfigurator> modelConfigurators); void setPossiblePageControllerArgumentProviders(List<PossiblePageControllerArgumentProvider> possiblePageControllerArgumentProviders); void setPageRequestInterceptors(List<PageRequestInterceptor> pageRequestInterceptors); }
PageFactory { public String handle(PageRequest request) throws PageAction { long startTime = System.currentTimeMillis(); PageContext context = new PageContext(request); context.setMessageSource(messageSource); context.setPageFactory(this); context.setFragmentFactory(fragmentFactory); context.setExtensionManager(extensionManager); overridePageProviderAndName(request); if (modelConfigurators != null) { for (PageModelConfigurator pageModelConfigurator : modelConfigurators) { pageModelConfigurator.configureModel(context); } } String result = process(context); if (log.isDebugEnabled()) { log.debug(">>> Page >>> handled " + request + " in " + (System.currentTimeMillis() - startTime) + " ms"); } request.getResponse().setHeader("Cache-Control", "no-cache,no-store,must-revalidate"); request.getResponse().setHeader("Pragma", "no-cache"); request.getResponse().setDateHeader("Expires", 0); return result; }  String handle(PageRequest request); String process(PageContext context); Map<String, PageControllerProvider> getControllerProviders(); void setControllerProviders(Map<String, PageControllerProvider> newControllerProviders); void setAdditionalControllerProviders(Map<String, PageControllerProvider> additional); void addControllerProvider(String key, PageControllerProvider provider); Map<String, PageViewProvider> getViewProviders(); void setViewProviders(Map<String, PageViewProvider> newViewProviders); void setAdditionalViewProviders(Map<String, PageViewProvider> additional); void addViewProvider(String key, PageViewProvider provider); List<PageRequestMapper> getRequestMappers(); void setRequestMappers(List<PageRequestMapper> requestMappers); ConversionService getConversionService(); List<PageModelConfigurator> getModelConfigurators(); void setModelConfigurators(List<PageModelConfigurator> modelConfigurators); void setPossiblePageControllerArgumentProviders(List<PossiblePageControllerArgumentProvider> possiblePageControllerArgumentProviders); void setPageRequestInterceptors(List<PageRequestInterceptor> pageRequestInterceptors);  }