congrats Icon
New! Announcing our next generation AI code completions
Read here
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

  • Reactive rest calls using spring rest template
  • requestLocationUpdates (LocationManager)
  • getResourceAsStream (ClassLoader)
  • getSharedPreferences (Context)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Top 25 Plugins for Webstorm
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