Package org.springframework.web.servlet.mvc.annotation

Examples of org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter$ArgumentsResolver


  @Before
  public void login() {
    // assure security context is set
    securityManager.createSecurityContext(null);
    adapter = new AnnotationMethodHandlerAdapter();
  }
View Full Code Here


                    .getClass().getName()));

            // 将处理器与对应的适配器放入映射中
            if (!pluginControllerInfo.getHandlerAdapterMap()
                .containsKey(handler)) {
              AnnotationMethodHandlerAdapter adapter = new AnnotationMethodHandlerAdapter();
              adapter.setPathMatcher(new PluginPathMatcher(bundle
                  .getSymbolicName()));
              adapter.setUrlPathHelper(new PluginUrlPathHelper());
              pluginControllerInfo.getHandlerAdapterMap().put(
                  handler, adapter);
            }
          }
        }
View Full Code Here

      }
      return null;
    }

    // 得到该处理器对应的适配器
    AnnotationMethodHandlerAdapter adapter = pluginControllerInfo
        .getHandlerAdapterMap().get(handler);

    try {
      // 执行处理,得到模型与视图
      ModelAndView mav = adapter.handle(request, response, handler);
      if (mav == null) {
        return null;
      }
      return mav;
    } catch (Exception ex) {
View Full Code Here

    return bean;
  }

  public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
    if (bean instanceof AnnotationMethodHandlerAdapter) {
      AnnotationMethodHandlerAdapter adapter = (AnnotationMethodHandlerAdapter) bean;
      HttpMessageConverter<?>[] converters = adapter.getMessageConverters();
      for (HttpMessageConverter<?> converter : converters) {
        if (converter instanceof MappingJacksonHttpMessageConverter) {
          MappingJacksonHttpMessageConverter jsonConverter = (MappingJacksonHttpMessageConverter) converter;
          jsonConverter.setObjectMapper(new ConversionServiceAwareObjectMapper(this.conversionService));
        }       
View Full Code Here

    RequestMappingHandlerAdapter rmha = context.getBean(RequestMappingHandlerAdapter.class);
    assertThat(rmha.getMessageConverters(),
        Matchers.<HttpMessageConverter<?>> hasItems(instanceOf(MappingJackson2HttpMessageConverter.class)));

    AnnotationMethodHandlerAdapter amha = context.getBean(AnnotationMethodHandlerAdapter.class);
    assertThat(Arrays.asList(amha.getMessageConverters()),
        Matchers.<HttpMessageConverter<?>> hasItems(instanceOf(MappingJackson2HttpMessageConverter.class)));
  }
View Full Code Here

      return adapter;
    }

    @Bean
    public AnnotationMethodHandlerAdapter amha() {
      AnnotationMethodHandlerAdapter adapter = new AnnotationMethodHandlerAdapter();
      numberOfMessageConvertersLegacy = adapter.getMessageConverters().length;
      return adapter;
    }
View Full Code Here

        adapter.setMessageConverters(potentiallyRegisterModule(adapter.getMessageConverters()));
      }

      if (bean instanceof AnnotationMethodHandlerAdapter) {

        AnnotationMethodHandlerAdapter adapter = (AnnotationMethodHandlerAdapter) bean;
        List<HttpMessageConverter<?>> augmentedConverters = potentiallyRegisterModule(Arrays.asList(adapter
            .getMessageConverters()));
        adapter
            .setMessageConverters(augmentedConverters.toArray(new HttpMessageConverter<?>[augmentedConverters.size()]));
      }

      return bean;
    }
View Full Code Here

TOP

Related Classes of org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter$ArgumentsResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.