public class OpenCmsServlet extends javax.servlet.http.HttpServlet implements I_CmsRequestHandler
From here, all operations that are results of HTTP requests are invoked. Any incoming request is handled in multiple steps:
CmsUser
is authenticated
and a CmsObject
with this users context information
is created. This CmsObject
is used to access all functions of OpenCms, limited by
the authenticated users permissions. If the user is not identified, it is set to the default user, usually named "Guest".CmsResource
is loaded into OpenCms and depending on its type
(and the users persmissions to display or modify it),
it is send to one of the OpenCms I_CmsResourceLoader
implementations
do be processed.I_CmsResourceLoader
will then decide what to do with the
contents of the requested CmsResource
.
In case of a JSP resource the JSP handling mechanism is invoked with the CmsJspLoader
,
in case of an image (or another static resource) this will be returned by the CmsDumpLoader
etc.
限定符和类型 | 字段和说明 |
---|---|
static java.lang.String |
HANDLE_GWT
GWT RPC services suffix.
|
static java.lang.String |
SERVLET_PARAM_DEFAULT_WEB_APPLICATION
Name of the
DefaultWebApplication parameter in the web.xml OpenCms servlet configuration. |
static java.lang.String |
SERVLET_PARAM_OPEN_CMS_HOME
Name of the
OpenCmsHome parameter in the web.xml OpenCms servlet configuration. |
static java.lang.String |
SERVLET_PARAM_OPEN_CMS_SERVLET
Name of the
OpenCmsServlet parameter in the web.xml OpenCms servlet configuration. |
static java.lang.String |
SERVLET_PARAM_WEB_APPLICATION_CONTEXT
Name of the
WebApplicationContext parameter in the web.xml OpenCms servlet configuration. |
构造器和说明 |
---|
OpenCmsServlet() |
限定符和类型 | 方法和说明 |
---|---|
void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
OpenCms servlet main request handling method.
|
void |
doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
OpenCms servlet POST request handling method,
will just call
doGet(HttpServletRequest, HttpServletResponse) . |
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.
|
void |
init(javax.servlet.ServletConfig config) |
protected void |
invokeHandler(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Manages requests to internal OpenCms request handlers.
|
protected void |
openErrorHandler(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
int errorCode)
Displays an error code handler loaded from the OpenCms VFS,
or if such a page does not exist,
displays the default servlet container error code.
|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
public static final java.lang.String HANDLE_GWT
public static final java.lang.String SERVLET_PARAM_DEFAULT_WEB_APPLICATION
DefaultWebApplication
parameter in the web.xml
OpenCms servlet configuration.public static final java.lang.String SERVLET_PARAM_OPEN_CMS_HOME
OpenCmsHome
parameter in the web.xml
OpenCms servlet configuration.public static final java.lang.String SERVLET_PARAM_OPEN_CMS_SERVLET
OpenCmsServlet
parameter in the web.xml
OpenCms servlet configuration.public static final java.lang.String SERVLET_PARAM_WEB_APPLICATION_CONTEXT
WebApplicationContext
parameter in the web.xml
OpenCms servlet configuration.public void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws java.io.IOException, javax.servlet.ServletException
doGet
在类中 javax.servlet.http.HttpServlet
java.io.IOException
javax.servlet.ServletException
HttpServlet.doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
public void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws java.io.IOException, javax.servlet.ServletException
doGet(HttpServletRequest, HttpServletResponse)
.doPost
在类中 javax.servlet.http.HttpServlet
java.io.IOException
javax.servlet.ServletException
HttpServlet.doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
public java.lang.String[] getHandlerNames()
I_CmsRequestHandler
getHandlerNames
在接口中 I_CmsRequestHandler
I_CmsRequestHandler.getHandlerNames()
public void handle(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, java.lang.String name) throws java.io.IOException, javax.servlet.ServletException
I_CmsRequestHandler
handle
在接口中 I_CmsRequestHandler
req
- the current requestres
- the current responsename
- the handler name to invokejava.io.IOException
- in case an error occursjavax.servlet.ServletException
- in case an error occursI_CmsRequestHandler.handle(HttpServletRequest, HttpServletResponse, String)
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
init
在接口中 javax.servlet.Servlet
init
在类中 javax.servlet.GenericServlet
javax.servlet.ServletException
Servlet.init(javax.servlet.ServletConfig)
protected void invokeHandler(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws java.io.IOException, javax.servlet.ServletException
req
- the current requestres
- the current responsejavax.servlet.ServletException
- in case an error occursjavax.servlet.ServletException
- in case an error occursjava.io.IOException
- in case an error occursprotected void openErrorHandler(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, int errorCode) throws java.io.IOException, javax.servlet.ServletException
req
- the current requestres
- the current responseerrorCode
- the error code to displayjava.io.IOException
- if something goes wrongjavax.servlet.ServletException
- if something goes wrong