Package jodd.madvoc.component

Examples of jodd.madvoc.component.ActionsManager.register()


  public void testAlias() {
    WebApplication webapp = new WebApplication(true);
    webapp.registerMadvocComponents();

    ActionsManager actionsManager = webapp.getComponent(ActionsManager.class);
    actionsManager.register(BooAction.class, "foo5");
    actionsManager.registerPathAlias("ok", "xxx.jsp");
    actionsManager.registerPathAlias("sok", "zzz");

    ResultMapper resultMapper = webapp.getComponent(ResultMapper.class);
View Full Code Here


  public void testAlias2() {
    WebApplication webapp = new WebApplication(true);
    webapp.registerMadvocComponents();

    ActionsManager actionsManager = webapp.getComponent(ActionsManager.class);
    actionsManager.register(BooAction.class, "foo2");
    actionsManager.registerPathAlias("/boo.foo2.xxx", "/aliased");

    ResultMapper resultMapper = webapp.getComponent(ResultMapper.class);
    ActionMethodParser actionMethodParser = webapp.getComponent(ActionMethodParser.class);
View Full Code Here

  public void testAlias3() {
    WebApplication webapp = new WebApplication(true);
    webapp.registerMadvocComponents();

    ActionsManager actionsManager = webapp.getComponent(ActionsManager.class);
    actionsManager.register(BooAction.class, "foo2");

    assertEquals("/boo.foo2.xxx", actionsManager.lookup(BooAction.class.getName() + "#foo2").actionPath);
  }

}
View Full Code Here

    webapp.registerMadvocComponents();
    ActionsManager actionsManager = webapp.getComponent(ActionsManager.class);
    MadvocConfig madvocConfig = webapp.getComponent(MadvocConfig.class);
    madvocConfig.getRootPackages().addRootPackageOf(this.getClass());

    actionsManager.register(ReAction.class, "macro");
    ActionConfig cfg = actionsManager.lookup("/re/user/173/macro.html", "GET");

    assertNotNull(cfg);
    ActionConfigSet set = cfg.getActionConfigSet();
    assertEquals(ReAction.class, cfg.actionClass);
View Full Code Here

    assertEquals(1, set.actionPathMacros.getMacrosCount());
    assertEquals("id", set.actionPathMacros.getNames()[0]);
    assertNull(set.actionPathMacros.getPatterns()[0]);


    actionsManager.register(ReAction.class, "macro2");
    cfg = actionsManager.lookup("/re/user/image/173/png/macro2.html", "GET");

    assertNotNull(cfg);
    set = cfg.getActionConfigSet();
    assertEquals(ReAction.class, cfg.actionClass);
View Full Code Here

    assertEquals(6, set.deep);
    assertEquals(2, set.actionPathMacros.getMacrosCount());
    assertEquals("id", set.actionPathMacros.getNames()[0]);
    assertEquals("fmt", set.actionPathMacros.getNames()[1]);

    actionsManager.register(ReAction.class, "macro3");
    cfg = actionsManager.lookup("/re/users/173/macro3", "POST");

    assertNotNull(cfg);
    set = cfg.getActionConfigSet();
    assertEquals(ReAction.class, cfg.actionClass);
View Full Code Here

    webapp.registerMadvocComponents();
    ActionsManager actionsManager = webapp.getComponent(ActionsManager.class);
    MadvocConfig madvocConfig = webapp.getComponent(MadvocConfig.class);
    madvocConfig.getRootPackages().addRootPackageOf(this.getClass());

    actionsManager.register(ReAction.class, "wild1");
    actionsManager.register(ReAction.class, "wild2");

    ActionConfig cfg = actionsManager.lookup("/re/ild123cat", "GET");
    assertNull(cfg);
View Full Code Here

    ActionsManager actionsManager = webapp.getComponent(ActionsManager.class);
    MadvocConfig madvocConfig = webapp.getComponent(MadvocConfig.class);
    madvocConfig.getRootPackages().addRootPackageOf(this.getClass());

    actionsManager.register(ReAction.class, "wild1");
    actionsManager.register(ReAction.class, "wild2");

    ActionConfig cfg = actionsManager.lookup("/re/ild123cat", "GET");
    assertNull(cfg);

    cfg = actionsManager.lookup("/re/wild123cat", "GET");
View Full Code Here

    MadvocConfig madvocConfig = webapp.getComponent(MadvocConfig.class);
    madvocConfig.getRootPackages().addRootPackageOf(this.getClass());
    madvocConfig.setPathMacroClass(RegExpPathMacros.class);

    actionsManager.register(ReAction.class, "duplo1");
    actionsManager.register(ReAction.class, "duplo2");

    ActionConfig cfg = actionsManager.lookup("/re/duplo/123", "GET");
    assertNotNull(cfg);
    ActionConfigSet set = cfg.getActionConfigSet();
View Full Code Here

    MadvocConfig madvocConfig = webapp.getComponent(MadvocConfig.class);
    madvocConfig.getRootPackages().addRootPackageOf(this.getClass());
    madvocConfig.setPathMacroClass(RegExpPathMacros.class);

    actionsManager.register(ReAction.class, "duplo1");
    actionsManager.register(ReAction.class, "duplo2");

    ActionConfig cfg = actionsManager.lookup("/re/duplo/123", "GET");
    assertNotNull(cfg);
    ActionConfigSet set = cfg.getActionConfigSet();
    assertEquals(ReAction.class, cfg.actionClass);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.