Package org.opencms.main
Interface I_CmsRequestHandler
-
- All Known Implementing Classes:
CmsStaticResourceHandler
,OpenCmsServlet
,OpenCmsServletErrorHandler
,OpenCmsSolrHandler
,OpenCmsSpellcheckHandler
public interface I_CmsRequestHandler
Describes an OpenCms request handler.Request handlers are used for special requests to OpenCms that should NOT be mapped to a VFS resource. A request handler URI always start with
/handle
and then one or more possible handler names as defined with thegetHandlerNames()
method.For example, if a registerd request handler has the name
"MyName"
, any request (in a simple setup) to/opencms/opencms/handlerMyName...
will directly be transfered to thehandle(HttpServletRequest, HttpServletResponse, String)
method of this handler.In essence, the request handlers are like simplified mini-servlets that run inside OpenCms. Of course they are not intended as replacements for real servlets. In case you require sophisticated lifecycle support use a genuine servlet instead.
- Since:
- 6.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default CmsParameterConfiguration
getConfiguration()
Gets the configuration.java.lang.String[]
getHandlerNames()
Returns the handler name.void
handle(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, java.lang.String name)
Handles an OpenCms request.default void
initParameters(CmsParameterConfiguration params)
Initializes parameters.
-
-
-
Method Detail
-
getConfiguration
default CmsParameterConfiguration getConfiguration()
Gets the configuration.- Returns:
- the configuration
-
getHandlerNames
java.lang.String[] getHandlerNames()
Returns the handler name.- Returns:
- the handler name
-
handle
void handle(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, java.lang.String name) throws java.io.IOException, javax.servlet.ServletException
Handles an OpenCms request.- Parameters:
req
- the current requestres
- the current responsename
- the handler name to invoke- Throws:
javax.servlet.ServletException
- in case an error occursjava.io.IOException
- in case an error occurs
-
initParameters
default void initParameters(CmsParameterConfiguration params)
Initializes parameters.- Parameters:
params
- the map of parameters
-
-