Class DefaultInvocationFinder

java.lang.Object
cloud.piranha.webapp.impl.DefaultInvocationFinder

public class DefaultInvocationFinder extends Object
The invocation finder tries to find a servlet invocation matching a request for a path based or name based dispatch.

Invocations returned by this finder take into account the various mappings, filters, welcome files and the default servlet.

Author:
Arjan Tijms
  • Constructor Details

    • DefaultInvocationFinder

      public DefaultInvocationFinder(DefaultWebApplication webApplication)
      Constructor.
      Parameters:
      webApplication - the web application.
  • Method Details

    • findServletInvocationByPath

      public DefaultServletInvocation findServletInvocationByPath(String servletPath, String pathInfo) throws IOException, ServletException
      Find the servlet invocation by path.
      Parameters:
      servletPath - the servlet path.
      pathInfo - the path info.
      Returns:
      the servlet invocation.
      Throws:
      IOException - when an I/O error occurs.
      ServletException - when a Servlet error occurs.
    • findServletInvocationByPath

      public DefaultServletInvocation findServletInvocationByPath(DispatcherType dispatcherType, String servletPath, String pathInfo) throws IOException, ServletException
      Find the servlet invocation by path.
      Parameters:
      dispatcherType - the dispatcher type.
      servletPath - the servlet path.
      pathInfo - the path info.
      Returns:
      the servlet invocation.
      Throws:
      IOException - when an I/O error occurs.
      ServletException - when a Servlet error occurs.
    • addFilters

      public DefaultServletInvocation addFilters(DispatcherType dispatcherType, DefaultServletInvocation servletInvocation, String servletPath, String pathInfo)
      Add the filters.
      Parameters:
      dispatcherType - the dispatcher type.
      servletInvocation - the servlet invocation.
      servletPath - the servlet path.
      pathInfo - the path info.
      Returns:
      the servlet invocation.
    • findServletInvocationByName

      public DefaultServletInvocation findServletInvocationByName(String servletName)
      Find the servlet invocation by servlet name.
      Parameters:
      servletName - the servlet name.
      Returns:
      the servlet invocation, or null if not found.
    • findFilterEnvironments

      protected List<FilterEnvironment> findFilterEnvironments(DispatcherType dispatcherType, String servletPath, String pathInfo, String servletName)
      Find the filter environments.
      Parameters:
      dispatcherType - the dispatcher type.
      servletPath - the servlet path to which filters should apply.
      pathInfo - the path info to which filters should apply.
      servletName - name of the servlet to be filtered, if any. Can be null.
      Returns:
      the filter environments.