congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
ActionDefinition.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
jodd.madvoc.config.ActionDefinition
constructor

Best Java code snippets using jodd.madvoc.config.ActionDefinition.<init> (Showing top 10 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew ArrayList()
  • Codota Iconnew LinkedList()
  • Smart code suggestions by Tabnine
}
origin: oblac/jodd

/**
 * Single point of {@link ActionDefinition} creation.
 * Also performs the replacement of action path macros!
 */
protected ActionDefinition createActionDef(String path, String httpMethod, String resultBasePath, final ActionNames actionNames) {
  path = replaceActionNameMacros(path, actionNames);
  if (httpMethod != null) {
    httpMethod = replaceActionNameMacros(httpMethod, actionNames);
  }
  if (resultBasePath != null) {
    resultBasePath = replaceActionNameMacros(resultBasePath, actionNames);
  }
  return new ActionDefinition(path, httpMethod, resultBasePath);
}
origin: oblac/jodd

actionDefinition = new ActionDefinition(actionPath, method, resultBasePath);
actionDefinition = new ActionDefinition(actionPath, method);
origin: oblac/jodd

protected ActionRequest createActionRequest(String actionPath) {
  HttpServletRequest servletRequest = mock(HttpServletRequest.class);
  HttpServletResponse servletResponse = mock(HttpServletResponse.class);
  HttpSession httpSession = mock(HttpSession.class);
  ServletContext servletContext = mock(ServletContext.class);
  when(servletRequest.getSession()).thenReturn(httpSession);
  when(httpSession.getServletContext()).thenReturn(servletContext);
  MadvocController madvocController = new MadvocController();
  Object action = new Object();
  ActionRuntime actionRuntime = new ActionRuntime(
      null,
      Action.class,
      ClassUtil.findMethod(Action.class, "view"),
      null, null,
      new ActionDefinition(actionPath, "GET"),
      ServletDispatcherActionResult.class, null, false, false, null, null);
  return new ActionRequest(madvocController, actionRuntime.getActionPath(), MadvocUtil.splitPathToChunks(actionRuntime.getActionPath()), actionRuntime, action, servletRequest, servletResponse);
}
origin: oblac/jodd

private MyActionRequest createMyActionRequest(ActionFilter[] actionFilters, ActionInterceptor[] actionInterceptors) {
  SimpleMadvocController madvocController = new SimpleMadvocController();
  Action action = new Action();
  ActionRuntime actionRuntime = new ActionRuntime(
      null,
      Action.class,
      ClassUtil.findMethod(Action.class, "view"),
      actionFilters, actionInterceptors,
      new ActionDefinition("path", "method"),
      ServletDispatcherActionResult.class,
      null,
      false, false, null, null);
  return new MyActionRequest(
      madvocController, "actionPath", actionRuntime, action, null, null);
}
origin: oblac/jodd

@Test
void testActionPathMacros2() {
  WebApp webapp = new WebApp();
  webapp.start();
  
  ActionsManager actionsManager = webapp.madvocContainer().lookupComponent(ActionsManager.class);
  actionsManager.registerAction(FooAction.class, "two", new ActionDefinition("/xxx-{two}"));
  actionsManager.registerAction(FooAction.class, "one", new ActionDefinition("/{one}"));
  ActionRuntime actionRuntime = actionsManager.routes.lookup(null, MadvocUtil.splitPathToChunks("/foo"));
  assertEquals("one", actionRuntime.getActionClassMethod().getName());
  actionRuntime = actionsManager.routes.lookup(null, MadvocUtil.splitPathToChunks("/foo/boo"));
  assertNull(actionRuntime);
  actionRuntime = actionsManager.routes.lookup(null, MadvocUtil.splitPathToChunks("/xxx-foo"));
  assertEquals("two", actionRuntime.getActionClassMethod().getName());	// best match!
}
origin: oblac/jodd

@Test
void testActionPathMacros4() {
  WebApp webapp = new WebApp();
  webapp.start();
  ActionsManager actionsManager = webapp.madvocContainer().lookupComponent(ActionsManager.class);
  actionsManager.registerAction(FooAction.class, "one", new ActionDefinition("/dummy"));		// no macro
  actionsManager.registerAction(FooAction.class, "one", new ActionDefinition("/{one}"));
  actionsManager.registerAction(FooAction.class, "three", new ActionDefinition("/life/{three}"));
  actionsManager.registerAction(FooAction.class, "two", new ActionDefinition("/{two}/{three}"));
  ActionRuntime actionRuntime = actionsManager.routes.lookup(null, MadvocUtil.splitPathToChunks("/foo"));
  assertEquals("one", actionRuntime.getActionClassMethod().getName());
  actionRuntime = actionsManager.routes.lookup(null, MadvocUtil.splitPathToChunks("/scott/ramonna"));
  assertEquals("two", actionRuntime.getActionClassMethod().getName());
  actionRuntime = actionsManager.routes.lookup(null, MadvocUtil.splitPathToChunks("/life/universe"));
  assertEquals("three", actionRuntime.getActionClassMethod().getName());
  actionRuntime = actionsManager.routes.lookup(null, MadvocUtil.splitPathToChunks("/scott/ramonna/envy"));
  assertNull(actionRuntime);
  actionRuntime = actionsManager.routes.lookup(null, MadvocUtil.splitPathToChunks("/life/universe/else"));
  assertNull(actionRuntime);
}
origin: oblac/jodd

@Test
void testActionPathMacros3() {
  WebApp webapp = new WebApp();
  webapp.start();
  ActionsManager actionsManager = webapp.madvocContainer().lookupComponent(ActionsManager.class);
  actionsManager.registerAction(FooAction.class, "one", new ActionDefinition("/yyy-{one}"));
  actionsManager.registerAction(FooAction.class, "two", new ActionDefinition("/xxx-{two}"));
  assertEquals(2, actionsManager.getActionsCount());
  ActionRuntime actionRuntime = actionsManager.routes.lookup(null, MadvocUtil.splitPathToChunks("/foo"));
  assertNull(actionRuntime);
  actionRuntime = actionsManager.routes.lookup(null, MadvocUtil.splitPathToChunks("/yyy-111"));
  assertEquals("one", actionRuntime.getActionClassMethod().getName());
  actionRuntime = actionsManager.routes.lookup(null, MadvocUtil.splitPathToChunks("/xxx-222"));
  assertEquals("two", actionRuntime.getActionClassMethod().getName());
  try {
    actionsManager.registerAction(FooAction.class, "two", new ActionDefinition("/xxx-{two}"));
    fail("error");
  } catch (Exception ex) {
    // ignore
  }
}
origin: oblac/jodd

  @Test
  void testActionPathMacrosWildcard() {
    WebApp webapp = new WebApp();
    webapp.start();

    ActionsManager actionsManager = webapp.madvocContainer().lookupComponent(ActionsManager.class);
    actionsManager.setPathMacroClass(WildcardPathMacros.class);

    actionsManager.registerAction(FooAction.class, "one", new ActionDefinition("/{one:a?a}"));

    ActionRuntime actionRuntime = actionsManager.routes.lookup(null, MadvocUtil.splitPathToChunks("/aaa"));
    assertNotNull(actionRuntime);

    actionRuntime = actionsManager.routes.lookup(null, MadvocUtil.splitPathToChunks("/aab"));
    assertNull(actionRuntime);
  }
}
origin: oblac/jodd

@Test
void testActionPathMacrosRegexp() {
  WebApp webapp = new WebApp();
  webapp.start();
  ActionsManager actionsManager = webapp.madvocContainer().lookupComponent(ActionsManager.class);
  actionsManager.setPathMacroClass(RegExpPathMacros.class);
  actionsManager.registerAction(FooAction.class, "one", new ActionDefinition("/{one:[ab]+}"));
  ActionRuntime actionRuntime = actionsManager.routes.lookup(null, MadvocUtil.splitPathToChunks("/a"));
  assertNotNull(actionRuntime);
  actionRuntime = actionsManager.routes.lookup(null, MadvocUtil.splitPathToChunks("/ac"));
  assertNull(actionRuntime);
}
origin: oblac/jodd

@Test
void testActionPathMacros1() {
  WebApp webapp = new WebApp();
  webapp.start();
  ActionsManager actionsManager = webapp.madvocContainer().lookupComponent(ActionsManager.class);
  actionsManager.registerAction(FooAction.class, "one", new ActionDefinition("/{one}"));
  ActionRuntime actionRuntime = actionsManager.routes.lookup(null, MadvocUtil.splitPathToChunks("/foo"));
  assertNotNull(actionRuntime);
  actionRuntime = actionsManager.routes.lookup(null, MadvocUtil.splitPathToChunks("/foo/boo"));
  assertNull(actionRuntime);
  actionRuntime = actionsManager.routes.lookup(null, MadvocUtil.splitPathToChunks("/foo/boo/zoo"));
  assertNull(actionRuntime);
}
jodd.madvoc.configActionDefinition<init>

Popular methods of ActionDefinition

  • actionMethod
    Returns action's HTTP method.
  • actionPath
    Returns action's path.
  • resultBasePath
    Returns result base path.

Popular in Java

  • Creating JSON documents from java classes using gson
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSystemService (Context)
  • getSupportFragmentManager (FragmentActivity)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • JPanel (javax.swing)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now