예제 #1
0
 @Bean
 public InternalResourceViewResolver jspViewResolver() {
   InternalResourceViewResolver bean = new InternalResourceViewResolver();
   bean.setPrefix("/WEB-INF/views/");
   bean.setSuffix(".jsp");
   return bean;
 }
예제 #2
0
 // @Bean
 public InternalResourceViewResolver viewResolver1() {
   InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
   viewResolver.setViewClass(JstlView.class);
   viewResolver.setPrefix("/WEB-INF/views/");
   viewResolver.setSuffix(".jsp");
   return viewResolver;
 }
예제 #3
0
 @Bean
 public ViewResolver resolver() {
   InternalResourceViewResolver url = new InternalResourceViewResolver();
   url.setPrefix("/WEB-INF/pages/");
   url.setSuffix(".jsp");
   return url;
 }
예제 #4
0
  @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();
  }
예제 #5
0
 @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;
 }
예제 #7
0
파일: AppConfig.java 프로젝트: imxood/app
 @Bean
 public ViewResolver viewResolver() {
   InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
   viewResolver.setPrefix("/");
   viewResolver.setSuffix(".jsp");
   return viewResolver;
 }
예제 #8
0
 @Bean
 public ViewResolver viewResolver() {
   InternalResourceViewResolver result = new InternalResourceViewResolver();
   result.setPrefix("/WEB-INF/view/");
   result.setSuffix(".jsp");
   return result;
 }
예제 #9
0
 @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;
 }
예제 #11
0
 @Bean
 public InternalResourceViewResolver internalResourceViewResolver() {
   InternalResourceViewResolver resolver = new InternalResourceViewResolver();
   resolver.setPrefix("/WEB-INF/views/");
   resolver.setSuffix(".jsp");
   return resolver;
 }
예제 #12
0
  @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;
 }
예제 #14
0
 @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);
 }
예제 #17
0
 @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;
 }
예제 #19
0
  /** @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;
  }
예제 #20
0
  // а этот бин инициализирует 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;
  }
예제 #22
0
 @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;
 }
예제 #23
0
 @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;
 }
예제 #24
0
  @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();
  }
예제 #27
0
  @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;
  }
예제 #28
0
  @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();
  }
예제 #29
0
  @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;
  }
예제 #30
0
 private ViewResolver getJspViewResolver() {
   InternalResourceViewResolver r2 = new InternalResourceViewResolver();
   r2.setPrefix("/WEB-INF/");
   r2.setSuffix(".jsp");
   return r2;
 }