class SuffixPipeline extends UrlPipeline
The suffix string is literally matched against the path info of the servlet
request, as this class assumes it is invoked by MetaServlet
. Suffix
strings may include path components. Examples include /info/refs
, or
just simple extension matches like .txt
.
When dispatching to the rest of the pipeline the HttpServletRequest is
modified so that getPathInfo()
does not contain the suffix that
caused this pipeline to be selected.
Modifier and Type | Class and Description |
---|---|
(package private) static class |
SuffixPipeline.Binder |
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
suffix |
private int |
suffixLen |
Constructor and Description |
---|
SuffixPipeline(java.lang.String suffix,
javax.servlet.Filter[] filters,
javax.servlet.http.HttpServlet servlet) |
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
match(javax.servlet.http.HttpServletRequest req)
Determine if this pipeline handles the request's URL.
|
(package private) void |
service(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse rsp)
Execute the filters and the servlet on the request.
|
java.lang.String |
toString() |
destroy, init
SuffixPipeline(java.lang.String suffix, javax.servlet.Filter[] filters, javax.servlet.http.HttpServlet servlet)
boolean match(javax.servlet.http.HttpServletRequest req)
UrlPipeline
This method should match on the request's getPathInfo()
method,
as MetaServlet
passes the request along as-is to each pipeline's
match method.
match
in class UrlPipeline
req
- current HTTP request being considered by MetaServlet
.true
if this pipeline is configured to handle the
request; false
otherwise.void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse rsp) throws javax.servlet.ServletException, java.io.IOException
UrlPipeline
Invoked by MetaServlet
once UrlPipeline.match(HttpServletRequest)
has determined this pipeline is the correct pipeline to handle the
current request.
service
in class UrlPipeline
req
- current HTTP request.rsp
- current HTTP response.javax.servlet.ServletException
- request cannot be completed.java.io.IOException
- IO error prevents the request from being completed.public java.lang.String toString()
toString
in class java.lang.Object