Package com.ibm.websphere.servlet.filter
Class ChainerServlet
- java.lang.Object
-
- jakarta.servlet.GenericServlet
-
- jakarta.servlet.http.HttpServlet
-
- com.ibm.websphere.servlet.filter.ChainerServlet
-
- All Implemented Interfaces:
java.io.Serializable
,jakarta.servlet.Servlet
,jakarta.servlet.ServletConfig
public class ChainerServlet extends jakarta.servlet.http.HttpServlet
Deprecated.Application developers requiring this functionality should implement this using jakarta.servlet.filter classes.Servlet that chains the responses of servlets together. This servlet requires an init parameter 'chained.path.list' that contains a space delimited list of servlet paths that should be chained together. A servlet chain acts as a response pipe that allows servlets to filter the output of the previous servlet in the chain. When a servlet writes header or output stream data to the response, this data is fed into a chained request object that will be passed to the next servlet in the chain. The next servlet can examine the contents of the chained request to see the response that was generated by the previous servlet. The data written by the last servlet in the chain will be sent back to the client. To setup a servlet chain, an instance of this servlet must be registered as the target servlet in the engine. When this servlet is invoked, the response will be generated by chaining the response of each servlet in the chainer.pathlist parameter. The response of the final servlet in the chain will be written to the client (Deprecated since WebSphere 6.0).
Example usage: Setup a servlet chain at the URI /servlet/upperCaseSnoop for /servlet/snoop-->/servlet/upperCaseFilter. The result of this chain should force the output of snoop to become capitalized.- Step 1: Register an instance of ChainerServlet and map it to URI /servlet/upperCaseSnoop
- Step 2: Add an init parameter of 'chainer.pathlist=/servlet/snoop /servlet/upperCaseFilter'
- Step 3: Request the URL: http://host/servlet/upperCaseSnoop
Required init parameters
- chainer.pathlist: space separated list of servlet paths to chain together
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PARAM_SERVLET_PATHS
Deprecated.chainer.pathlist: the name of the parameter that specifies the chained servlet path list.
-
Constructor Summary
Constructors Constructor Description ChainerServlet()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
destroy()
Deprecated.void
init()
Deprecated.Initialize the servlet chainer.void
service(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
Deprecated.Handle a servlet request by chaining the configured list of servlets.
-
-
-
Field Detail
-
PARAM_SERVLET_PATHS
public static final java.lang.String PARAM_SERVLET_PATHS
Deprecated.chainer.pathlist: the name of the parameter that specifies the chained servlet path list.- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init() throws jakarta.servlet.ServletException
Deprecated.Initialize the servlet chainer.- Overrides:
init
in classjakarta.servlet.GenericServlet
- Throws:
jakarta.servlet.ServletException
-
service
public void service(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws jakarta.servlet.ServletException, java.io.IOException
Deprecated.Handle a servlet request by chaining the configured list of servlets. Only the final response in the chain will be sent back to the client. This servlet does not actual generate any content. This servlet only constructs and processes the servlet chain.- Parameters:
req
- HttpServletRequestresp
- HttpServletResponse- Throws:
jakarta.servlet.ServletException
java.io.IOException
-
destroy
public void destroy()
Deprecated.- Specified by:
destroy
in interfacejakarta.servlet.Servlet
- Overrides:
destroy
in classjakarta.servlet.GenericServlet
-
-