java.lang.Object
cloud.piranha.core.impl.DefaultInvocationFinder
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddFilters
(jakarta.servlet.DispatcherType dispatcherType, DefaultServletInvocation servletInvocation, String servletPath, String pathInfo) Add the filters.protected List<FilterEnvironment>
findFilterEnvironments
(jakarta.servlet.DispatcherType dispatcherType, String servletPath, String pathInfo, String servletName) Find the filter environments.findServletInvocationByName
(String servletName) Find the servlet invocation by servlet name.findServletInvocationByPath
(jakarta.servlet.DispatcherType dispatcherType, String servletPath, String pathInfo) Find the servlet invocation by path.findServletInvocationByPath
(String servletPath, String pathInfo) Find the servlet invocation by path.
-
Constructor Details
-
DefaultInvocationFinder
Constructor.- Parameters:
webApplication
- the web application.
-
-
Method Details
-
findServletInvocationByPath
public DefaultServletInvocation findServletInvocationByPath(String servletPath, String pathInfo) throws IOException, jakarta.servlet.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.jakarta.servlet.ServletException
- when a Servlet error occurs.
-
findServletInvocationByPath
public DefaultServletInvocation findServletInvocationByPath(jakarta.servlet.DispatcherType dispatcherType, String servletPath, String pathInfo) throws IOException, jakarta.servlet.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.jakarta.servlet.ServletException
- when a Servlet error occurs.
-
addFilters
public DefaultServletInvocation addFilters(jakarta.servlet.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
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(jakarta.servlet.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.
-