Tabnine Logo
MadvocServletFilter
Code IndexAdd Tabnine to your IDE (free)

How to use
MadvocServletFilter
in
jodd.madvoc

Best Java code snippets using jodd.madvoc.MadvocServletFilter (Showing top 3 results out of 315)

origin: oblac/jodd

/**
 * Builds {@link ActionRequest} and invokes it. If action result is a chain, it repeats the process.
 */
@Override
public void doFilter(final ServletRequest req, final ServletResponse res, final FilterChain chain) throws IOException, ServletException {
  HttpServletRequest request = (HttpServletRequest) req;
  HttpServletResponse response = (HttpServletResponse) res;
  String actionPath = DispatcherUtil.getServletPath(request);
  try {
    MadvocResponseWrapper madvocResponse = new MadvocResponseWrapper(response);
    actionPath = madvocController.invoke(actionPath, request, madvocResponse);
  } catch (Exception ex) {
    log.error("Invoking action path failed: " + actionPath, ex);
    throw new ServletException(ex);
  }
  if (actionPath != null) {	// action path is not consumed
    boolean pathProcessed = processUnhandledPath(actionPath, req, res);
    if (!pathProcessed) {
      chain.doFilter(request, response);
    }
  }
}
origin: org.jodd/jodd-wot

/**
 * Filter initialization.
 */
public void init(FilterConfig filterConfig) throws ServletException {
  ServletContext servletContext = filterConfig.getServletContext();
  madvoc = Madvoc.get(servletContext);
  if (madvoc == null) {
    madvoc = createMadvoc(filterConfig);
    try {
      madvoc.startNewWebApplication(servletContext);
    } catch (Exception ex) {
      throw new ServletException("Unable to start Madvoc web application.", ex);
    }
  }
  log = Log.getLogger(MadvocServletFilter.class);
  madvocController = madvoc.getMadvocController();
}
origin: org.jodd/jodd-wot

/**
 * Builds {@link ActionRequest} and invokes it. If action result is a chain, it repeats the process.
 */
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
  HttpServletRequest request = (HttpServletRequest) req;
  HttpServletResponse response = (HttpServletResponse) res;
  String actionPath = DispatcherUtil.getServletPath(request);
  try {
    actionPath = madvocController.invoke(actionPath, request, response);
  } catch (Exception ex) {
    log.error("Exception while invoking action path: " + actionPath, ex);
    ex.printStackTrace();
    throw new ServletException(ex);
  }
  if (actionPath != null) {	// action path is not consumed
    actionPath = processUnhandledPath(actionPath, req, res);
    if (actionPath != null) {
      chain.doFilter(request, response);
    }
  }
}
jodd.madvocMadvocServletFilter

Javadoc

Madvoc filter serves as a jodd.madvoc.component.MadvocController part of the Madvoc framework.

Most used methods

  • processUnhandledPath
    Process unconsumed action paths. Returns null if action path is consumed, otherwise returns action p
  • createMadvoc
    Creates Madvoc if not already created. Override it to set custom MadvocConfig or other core settings

Popular in Java

  • Start an intent from android
  • getContentResolver (Context)
  • setRequestProperty (URLConnection)
  • getResourceAsStream (ClassLoader)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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