Package org.springframework.web.portlet.context

Examples of org.springframework.web.portlet.context.StaticPortletApplicationContext


  @Test
  public void specificBinderInitializingCommandProvidingFormController() throws Exception {
    DispatcherPortlet portlet = new DispatcherPortlet() {
      @Override
      protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
        StaticPortletApplicationContext wac = new StaticPortletApplicationContext();
        wac.registerBeanDefinition("controller", new RootBeanDefinition(MySpecificBinderInitializingCommandProvidingFormController.class));
        wac.refresh();
        return wac;
      }
      @Override
      protected void render(ModelAndView mv, PortletRequest request, MimeResponse response) throws Exception {
        new TestView().render(mv.getViewName(), mv.getModel(), request, response);
View Full Code Here


  @Test
  public void parameterDispatchingController() throws Exception {
    DispatcherPortlet portlet = new DispatcherPortlet() {
      @Override
      protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
        StaticPortletApplicationContext wac = new StaticPortletApplicationContext();
        wac.setPortletContext(new MockPortletContext());
        RootBeanDefinition bd = new RootBeanDefinition(MyParameterDispatchingController.class);
        bd.setScope(WebApplicationContext.SCOPE_REQUEST);
        wac.registerBeanDefinition("controller", bd);
        AnnotationConfigUtils.registerAnnotationConfigProcessors(wac);
        wac.refresh();
        return wac;
      }
    };
    portlet.init(new MockPortletConfig());
View Full Code Here

  @Test
  public void typeLevelParameterDispatchingController() throws Exception {
    DispatcherPortlet portlet = new DispatcherPortlet() {
      @Override
      protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
        StaticPortletApplicationContext wac = new StaticPortletApplicationContext();
        wac.setPortletContext(new MockPortletContext());
        RootBeanDefinition bd = new RootBeanDefinition(MyTypeLevelParameterDispatchingController.class);
        bd.setScope(WebApplicationContext.SCOPE_REQUEST);
        wac.registerBeanDefinition("controller", bd);
        RootBeanDefinition bd2 = new RootBeanDefinition(MySpecialParameterDispatchingController.class);
        bd2.setScope(WebApplicationContext.SCOPE_REQUEST);
        wac.registerBeanDefinition("controller2", bd2);
        RootBeanDefinition bd3 = new RootBeanDefinition(MyOtherSpecialParameterDispatchingController.class);
        bd3.setScope(WebApplicationContext.SCOPE_REQUEST);
        wac.registerBeanDefinition("controller3", bd3);
        RootBeanDefinition bd4 = new RootBeanDefinition(MyParameterDispatchingController.class);
        bd4.setScope(WebApplicationContext.SCOPE_REQUEST);
        wac.registerBeanDefinition("controller4", bd4);
        AnnotationConfigUtils.registerAnnotationConfigProcessors(wac);
        wac.refresh();
        return wac;
      }
    };
    portlet.init(new MockPortletConfig());
View Full Code Here

  @Test
  public void portlet20DispatchingController() throws Exception {
    DispatcherPortlet portlet = new DispatcherPortlet() {
      @Override
      protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
        StaticPortletApplicationContext wac = new StaticPortletApplicationContext();
        wac.setPortletContext(new MockPortletContext());
        RootBeanDefinition bd = new RootBeanDefinition(MyPortlet20DispatchingController.class);
        bd.setScope(WebApplicationContext.SCOPE_REQUEST);
        wac.registerBeanDefinition("controller", bd);
        wac.registerBeanDefinition("controller2", new RootBeanDefinition(DetailsController.class));
        AnnotationConfigUtils.registerAnnotationConfigProcessors(wac);
        wac.refresh();
        return wac;
      }
    };
    portlet.init(new MockPortletConfig());
View Full Code Here

  @Test
  public void eventDispatchingController() throws Exception {
    DispatcherPortlet portlet = new DispatcherPortlet() {
      @Override
      protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
        StaticPortletApplicationContext wac = new StaticPortletApplicationContext();
        wac.setPortletContext(new MockPortletContext());
        RootBeanDefinition bd = new RootBeanDefinition(MyPortlet20DispatchingController.class);
        bd.setScope(WebApplicationContext.SCOPE_REQUEST);
        wac.registerBeanDefinition("controller", bd);
        wac.registerBeanDefinition("controller2", new RootBeanDefinition(DetailsController.class));
        AnnotationConfigUtils.registerAnnotationConfigProcessors(wac);
        wac.refresh();
        return wac;
      }
    };
    portlet.init(new MockPortletConfig());
View Full Code Here

  @Test
  public void testPredicatePriorityComparisonAcrossControllers() throws Exception {
    DispatcherPortlet portlet = new DispatcherPortlet() {
      @Override
      protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
        StaticPortletApplicationContext wac = new StaticPortletApplicationContext();
        // The order of handler registration is important to get
        // the collection with [Render,Action,Render] predicates
        wac.registerSingleton("firstController", FirstController.class);
        wac.registerSingleton("secondController", SecondController.class);
        wac.registerSingleton("thirdController", ThirdController.class);
        wac.registerSingleton("handlerMapping", DefaultAnnotationHandlerMapping.class);
        wac.registerSingleton("handlerAdapter", AnnotationMethodHandlerAdapter.class);
        wac.setPortletContext(new MockPortletContext());
        AnnotationConfigUtils.registerAnnotationConfigProcessors(wac);
        wac.refresh();
        return wac;
      }
    };
    portlet.init(new MockPortletConfig());
View Full Code Here

  }

  public void testSpecificBinderInitializingCommandProvidingFormController() throws Exception {
    DispatcherPortlet portlet = new DispatcherPortlet() {
      protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
        StaticPortletApplicationContext wac = new StaticPortletApplicationContext();
        wac.registerBeanDefinition("controller", new RootBeanDefinition(MySpecificBinderInitializingCommandProvidingFormController.class));
        wac.refresh();
        return wac;
      }

      protected void render(ModelAndView mv, RenderRequest request, RenderResponse response) throws Exception {
        new TestView().render(mv.getViewName(), mv.getModel(), request, response);
View Full Code Here

  }

  public void testParameterDispatchingController() throws Exception {
    DispatcherPortlet portlet = new DispatcherPortlet() {
      protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
        StaticPortletApplicationContext wac = new StaticPortletApplicationContext();
        wac.setPortletContext(new MockPortletContext());
        RootBeanDefinition bd = new RootBeanDefinition(MyParameterDispatchingController.class);
        bd.setScope(WebApplicationContext.SCOPE_REQUEST);
        wac.registerBeanDefinition("controller", bd);
        AnnotationConfigUtils.registerAnnotationConfigProcessors(wac);
        wac.refresh();
        return wac;
      }
    };
    portlet.init(new MockPortletConfig());
View Full Code Here

  }

  public void testTypeLevelParameterDispatchingController() throws Exception {
    DispatcherPortlet portlet = new DispatcherPortlet() {
      protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
        StaticPortletApplicationContext wac = new StaticPortletApplicationContext();
        wac.setPortletContext(new MockPortletContext());
        RootBeanDefinition bd = new RootBeanDefinition(MyTypeLevelParameterDispatchingController.class);
        bd.setScope(WebApplicationContext.SCOPE_REQUEST);
        wac.registerBeanDefinition("controller", bd);
        RootBeanDefinition bd2 = new RootBeanDefinition(MySpecialParameterDispatchingController.class);
        bd2.setScope(WebApplicationContext.SCOPE_REQUEST);
        wac.registerBeanDefinition("controller2", bd2);
        RootBeanDefinition bd3 = new RootBeanDefinition(MyOtherSpecialParameterDispatchingController.class);
        bd3.setScope(WebApplicationContext.SCOPE_REQUEST);
        wac.registerBeanDefinition("controller3", bd3);
        RootBeanDefinition bd4 = new RootBeanDefinition(MyParameterDispatchingController.class);
        bd4.setScope(WebApplicationContext.SCOPE_REQUEST);
        wac.registerBeanDefinition("controller4", bd4);
        AnnotationConfigUtils.registerAnnotationConfigProcessors(wac);
        wac.refresh();
        return wac;
      }
    };
    portlet.init(new MockPortletConfig());
View Full Code Here

TOP

Related Classes of org.springframework.web.portlet.context.StaticPortletApplicationContext

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.