@Bean public InternalResourceViewResolver jspViewResolver() { InternalResourceViewResolver bean = new InternalResourceViewResolver(); bean.setPrefix("/WEB-INF/views/"); bean.setSuffix(".jsp"); return bean; }
// @Bean public InternalResourceViewResolver viewResolver1() { InternalResourceViewResolver viewResolver = new InternalResourceViewResolver(); viewResolver.setViewClass(JstlView.class); viewResolver.setPrefix("/WEB-INF/views/"); viewResolver.setSuffix(".jsp"); return viewResolver; }
@Bean public ViewResolver resolver() { InternalResourceViewResolver url = new InternalResourceViewResolver(); url.setPrefix("/WEB-INF/pages/"); url.setSuffix(".jsp"); return url; }
@Before public void setup() { MockitoAnnotations.initMocks(this); account = new Account( "john", "malkovich", "Ireland", new BigInteger("500600700"), new BigInteger("1234567890"), new BigDecimal(25), "EUR"); accountForm = new AccountForm(); accountForm.setName("john"); accountForm.setSurname("malkovich"); accountForm.setAddress("Ireland"); accountForm.setPhone(new BigInteger("500600700")); accountForm.setIban(new BigInteger("1234567890")); accountForm.setBalance(new BigDecimal(25)); accountForm.setCurrency("EUR"); viewResolver = new InternalResourceViewResolver(); viewResolver.setPrefix("/WEB-INF/views/"); viewResolver.setSuffix(".jsp"); mockMvc = MockMvcBuilders.standaloneSetup(accountController).setViewResolvers(viewResolver).build(); }
@Bean public InternalResourceViewResolver getViewResolver() { InternalResourceViewResolver viewResolver = new InternalResourceViewResolver(); viewResolver.setPrefix("/WEB-INF/views/jsp/"); viewResolver.setSuffix(".jsp"); return viewResolver; }
static ViewResolver viewResolver() { InternalResourceViewResolver viewResolver = new InternalResourceViewResolver(); viewResolver.setViewClass(JstlView.class); viewResolver.setPrefix(PATH__PREFIX); viewResolver.setSuffix(PATH__SUFFIX); return viewResolver; }
@Bean public ViewResolver viewResolver() { InternalResourceViewResolver viewResolver = new InternalResourceViewResolver(); viewResolver.setPrefix("/"); viewResolver.setSuffix(".jsp"); return viewResolver; }
@Bean public ViewResolver viewResolver() { InternalResourceViewResolver result = new InternalResourceViewResolver(); result.setPrefix("/WEB-INF/view/"); result.setSuffix(".jsp"); return result; }
@Bean public InternalResourceViewResolver viewResolver() { InternalResourceViewResolver internalResourceViewResolver = new InternalResourceViewResolver(); internalResourceViewResolver.setPrefix(VIEWS); internalResourceViewResolver.setSuffix(".jsp"); return internalResourceViewResolver; }
@Bean public ViewResolver getViewResolver() { InternalResourceViewResolver resolver = new InternalResourceViewResolver(); resolver.setPrefix("/resources/"); resolver.setSuffix(".html"); return resolver; }
@Bean public InternalResourceViewResolver internalResourceViewResolver() { InternalResourceViewResolver resolver = new InternalResourceViewResolver(); resolver.setPrefix("/WEB-INF/views/"); resolver.setSuffix(".jsp"); return resolver; }
@Bean public InternalResourceViewResolver getInternalResourceViewResolver() { InternalResourceViewResolver resolver = new InternalResourceViewResolver(); resolver.setPrefix("/"); resolver.setSuffix(".jsp"); return resolver; }
/** Creates a <code>ViewResolver</code> instance that can match a view name to an actual view. */ @Bean public ViewResolver viewResolver() { InternalResourceViewResolver resolver = new InternalResourceViewResolver(); resolver.setViewClass(JstlView.class); resolver.setPrefix("/WEB-INF/jsp/view/"); resolver.setSuffix(".jsp"); return resolver; }
@Bean public ViewResolver viewResolver() { final InternalResourceViewResolver resolver = new InternalResourceViewResolver(); resolver.setPrefix("/WEB-INF/views/"); resolver.setSuffix(".jsp"); resolver.setExposeContextBeansAsAttributes(true); return resolver; }
@Bean public ViewResolver configureViewResolver() { InternalResourceViewResolver viewResolve = new InternalResourceViewResolver(); viewResolve.setPrefix("/WEB-INF/views/"); viewResolve.setSuffix(".jsp"); return viewResolve; }
@Override public void configureViewResolvers(ViewResolverRegistry registry) { InternalResourceViewResolver viewResolver = new InternalResourceViewResolver(); viewResolver.setViewClass(JstlView.class); viewResolver.setPrefix("/WEB-INF/views/"); viewResolver.setSuffix(".jsp"); registry.viewResolver(viewResolver); }
@Bean public ViewResolver viewResolver() { InternalResourceViewResolver viewResolver = new InternalResourceViewResolver(); viewResolver.setViewClass(JstlView.class); viewResolver.setPrefix(JSP_FILE_PATH); viewResolver.setSuffix(JSP_FILE_SUFFIX); return viewResolver; }
@Bean(name = "viewResolver") public InternalResourceViewResolver getViewResolver() { InternalResourceViewResolver viewResolver = new InternalResourceViewResolver(); // must have trailing slash viewResolver.setPrefix("/WEB-INF/jsp/"); viewResolver.setSuffix(".jsp"); return viewResolver; }
/** @return the view resolver */ @Bean public ViewResolver viewResolver() { logger.debug("setting up view resolver"); InternalResourceViewResolver viewResolver = new InternalResourceViewResolver(); viewResolver.setPrefix("/WEB-INF/pages/"); viewResolver.setSuffix(".zul"); return viewResolver; }
// а этот бин инициализирует View нашего проекта // точно это же мы делали в mvc-dispatcher-servlet.xml @Bean public InternalResourceViewResolver setupViewResolver() { InternalResourceViewResolver resolver = new InternalResourceViewResolver(); resolver.setPrefix("/pages/"); resolver.setSuffix(".jsp"); resolver.setViewClass(JstlView.class); return resolver; }
@Bean public ViewResolver viewResolver() { InternalResourceViewResolver viewResolver = new InternalResourceViewResolver(); viewResolver.setViewClass(JstlView.class); viewResolver.setPrefix(VIEW_RESOLVER_PREFIX); viewResolver.setSuffix(VIEW_RESOLVER_SUFFIX); return viewResolver; }
@Bean public InternalResourceViewResolver internalResourceViewResolver() { final InternalResourceViewResolver resolver = new InternalResourceViewResolver(); resolver.setPrefix("/WEB-INF/views/"); resolver.setSuffix(".jsp"); resolver.setOrder(2); resolver.setViewClass(BaseView.class); resolver.setExposedContextBeanNames(new String[] {"props"}); return resolver; }
@Bean public InternalResourceViewResolver internalResourceViewResolver() { InternalResourceViewResolver jspResolver = new InternalResourceViewResolver(); jspResolver.setViewClass(JstlView.class); jspResolver.setViewNames(new String[] {"jsp/*"}); jspResolver.setPrefix("/WEB-INF/views/"); jspResolver.setSuffix(".jsp"); jspResolver.setOrder(1); return jspResolver; }
@Before public void setup() { InternalResourceViewResolver viewResolver = new InternalResourceViewResolver(); viewResolver.setPrefix("/WEB-INF/templates/"); viewResolver.setSuffix(".html"); mockMvc = MockMvcBuilders.standaloneSetup(new SimpleController()) .setViewResolvers(viewResolver) .build(); }
@Before public void setUp() { InternalResourceViewResolver viewResolver = new InternalResourceViewResolver(); viewResolver.setPrefix("/WEB-INF/view/"); viewResolver.setSuffix(".jsp"); mockMvc = standaloneSetup(producerWebController) .setMessageConverters(new MappingJackson2HttpMessageConverter()) .setViewResolvers(viewResolver) .build(); mockServer = MockRestServiceServer.createServer(restTemplate); }
@Before public void setup() { Mockito.reset(bookService); InternalResourceViewResolver viewResolver = new InternalResourceViewResolver(); viewResolver.setPrefix("/WEB-INF/templates/"); viewResolver.setSuffix(".html"); mockMvc = MockMvcBuilders.standaloneSetup(new BookController()) .setViewResolvers(viewResolver) .build(); this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build(); }
@Bean public ViewResolver viewResolver(ContentNegotiationManagerFactoryBean contentManager) { InternalResourceViewResolver resolver = new InternalResourceViewResolver(); resolver.setPrefix("/WEB-INF/views/"); resolver.setSuffix(".jsp"); resolver.setExposeContextBeansAsAttributes(true); resolver.setViewClass(JstlView.class); // TilesViewResolver resolver = new TilesViewResolver(); // priority: file extension->Accept header // ContentNegotiatingViewResolver resolver = new ContentNegotiatingViewResolver(); // resolver.setContentNegotiationManager(contentManager.getObject()); return resolver; }
@Before public void setUp() throws Exception { SecurityContextHolder.clearContext(); IdentityZoneHolder.set(IdentityZone.getUaa()); resetPasswordService = mock(ResetPasswordService.class); messageService = mock(MessageService.class); ResetPasswordController controller = new ResetPasswordController( resetPasswordService, messageService, templateEngine, new UaaUrlUtils("http://foo/uaa"), "pivotal"); InternalResourceViewResolver viewResolver = new InternalResourceViewResolver(); viewResolver.setPrefix("/WEB-INF/jsp"); viewResolver.setSuffix(".jsp"); mockMvc = MockMvcBuilders.standaloneSetup(controller).setViewResolvers(viewResolver).build(); }
@Bean public ContentNegotiatingViewResolver contentViewResolver() throws Exception { ContentNegotiationManagerFactoryBean contentNegotiationManager = new ContentNegotiationManagerFactoryBean(); contentNegotiationManager.addMediaType("json", MediaType.APPLICATION_JSON); InternalResourceViewResolver viewResolver = new InternalResourceViewResolver(); viewResolver.setPrefix("/WEB-INF/views/"); viewResolver.setSuffix(".jsp"); MappingJackson2JsonView defaultView = new MappingJackson2JsonView(); defaultView.setExtractValueFromSingleKeyModel(true); ContentNegotiatingViewResolver contentViewResolver = new ContentNegotiatingViewResolver(); contentViewResolver.setContentNegotiationManager(contentNegotiationManager.getObject()); contentViewResolver.setViewResolvers(Arrays.<ViewResolver>asList(viewResolver)); contentViewResolver.setDefaultViews(Arrays.<View>asList(defaultView)); return contentViewResolver; }
private ViewResolver getJspViewResolver() { InternalResourceViewResolver r2 = new InternalResourceViewResolver(); r2.setPrefix("/WEB-INF/"); r2.setSuffix(".jsp"); return r2; }