Exemplo n.º 1
0
 @Bean
 public InternalResourceViewResolver jspViewResolver() {
   InternalResourceViewResolver bean = new InternalResourceViewResolver();
   bean.setPrefix("/WEB-INF/views/");
   bean.setSuffix(".jsp");
   return bean;
 }
Exemplo n.º 2
0
 // @Bean
 public InternalResourceViewResolver viewResolver1() {
   InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
   viewResolver.setViewClass(JstlView.class);
   viewResolver.setPrefix("/WEB-INF/views/");
   viewResolver.setSuffix(".jsp");
   return viewResolver;
 }
Exemplo n.º 3
0
 @Bean
 public ViewResolver resolver() {
   InternalResourceViewResolver url = new InternalResourceViewResolver();
   url.setPrefix("/WEB-INF/pages/");
   url.setSuffix(".jsp");
   return url;
 }
Exemplo n.º 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();
  }
Exemplo n.º 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;
 }
Exemplo n.º 7
0
 @Bean
 public ViewResolver viewResolver() {
   InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
   viewResolver.setPrefix("/");
   viewResolver.setSuffix(".jsp");
   return viewResolver;
 }
Exemplo n.º 8
0
 @Bean
 public ViewResolver viewResolver() {
   InternalResourceViewResolver result = new InternalResourceViewResolver();
   result.setPrefix("/WEB-INF/view/");
   result.setSuffix(".jsp");
   return result;
 }
Exemplo n.º 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;
 }
Exemplo n.º 11
0
 @Bean
 public InternalResourceViewResolver internalResourceViewResolver() {
   InternalResourceViewResolver resolver = new InternalResourceViewResolver();
   resolver.setPrefix("/WEB-INF/views/");
   resolver.setSuffix(".jsp");
   return resolver;
 }
Exemplo n.º 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;
 }
Exemplo n.º 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);
 }
Exemplo n.º 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;
 }
Exemplo n.º 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;
  }
Exemplo n.º 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;
  }
Exemplo n.º 22
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();
  }
Exemplo n.º 25
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;
  }
Exemplo n.º 26
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();
  }
Exemplo n.º 27
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;
  }
Exemplo n.º 28
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;
 }
Exemplo n.º 29
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;
 }
Exemplo n.º 30
0
 private ViewResolver getJspViewResolver() {
   InternalResourceViewResolver r2 = new InternalResourceViewResolver();
   r2.setPrefix("/WEB-INF/");
   r2.setSuffix(".jsp");
   return r2;
 }