|
|||||||||
| Home >> All >> com >> opencms >> [ core overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.opencms.core
Class OpenCmsHttpServlet

java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.opencms.core.OpenCmsHttpServlet
- All Implemented Interfaces:
- I_CmsConstants, com.opencms.boot.I_CmsLogChannels, java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
- public class OpenCmsHttpServlet
- extends javax.servlet.http.HttpServlet
- implements I_CmsConstants, com.opencms.boot.I_CmsLogChannels
- extends javax.servlet.http.HttpServlet
This the main servlet of the OpenCms system.
From here, all other operations are invoked. Any incoming request is handled in multiple steps:
- The requesting user is authenticated and a CmsObject with the user information is created. The 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 (guest) user.
- The requested document 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 launchers do be processed.
- The loaded launcher will then decide what to do with the contents of the requested document. In case of an XMLTemplate the template mechanism will be started, in case of a JSP the JSP handling mechanism is invoked, in case of an image (or other static file) this will simply be returned etc.
- Version:
- $Revision: 1.47 $ $Date: 2003/04/25 07:40:20 $
| Field Summary | |
private static java.lang.String |
C_ERRORMSG
Prefix for error messages for initialization errors. |
(package private) static java.lang.String |
C_PROPERTY_REDIRECT
The name of the redirect entry in the configuration file. |
(package private) static java.lang.String |
C_PROPERTY_REDIRECTLOCATION
The name of the redirect location entry in the configuration file. |
private static boolean |
DEBUG
Flag for debugging. |
private java.lang.String |
m_AuthenticationFormURI
URI of the authentication form (read from properties). |
private java.lang.String |
m_clusterurl
Storage for the clusterurl. |
private source.org.apache.java.util.Configurations |
m_configurations
The configuration for the OpenCms servlet. |
private OpenCms |
m_opencms
The reference to the OpenCms system. |
private CmsCoreSession |
m_sessionStorage
The session storage for all active users. |
private boolean |
m_UseBasicAuthentication
Flag to indicate if basic or form based authentication is used. |
| Fields inherited from class javax.servlet.http.HttpServlet |
|
| Fields inherited from class javax.servlet.GenericServlet |
|
| Fields inherited from interface com.opencms.boot.I_CmsLogChannels |
C_FLEX_CACHE, C_FLEX_LOADER, C_LOGGING, C_MODULE_CRITICAL, C_MODULE_DEBUG, C_MODULE_INFO, C_OPENCMS_CACHE, C_OPENCMS_CRITICAL, C_OPENCMS_CRONSCHEDULER, C_OPENCMS_DEBUG, C_OPENCMS_ELEMENTCACHE, C_OPENCMS_INFO, C_OPENCMS_INIT, C_OPENCMS_POOL, C_OPENCMS_STATICEXPORT, C_OPENCMS_STREAMING, C_PREPROCESSOR_IS_LOGGING |
| Constructor Summary | |
OpenCmsHttpServlet()
|
|
| Method Summary | |
private java.lang.String |
createErrorBox(CmsException e,
com.opencms.file.CmsObject cms)
Generates a formated exception output. |
void |
destroy()
Destroys all running threads before closing the VM. |
void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Method invoked on each HTML GET request. |
void |
doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Method invoked on each HTML POST request. |
private void |
errorHandling(com.opencms.file.CmsObject cms,
I_CmsRequest cmsReq,
I_CmsResponse cmsRes,
CmsException e)
This method performs the error handling for the OpenCms. |
java.lang.String |
getErrormsg(java.lang.String part)
Get the value for the property entry |
void |
init(javax.servlet.ServletConfig config)
Initialization of the OpenCms servlet (overloaded Servlet API method). |
private com.opencms.file.CmsObject |
initUser(I_CmsRequest cmsReq,
I_CmsResponse cmsRes)
This method handled the user authentification for each request sent to the OpenCms. |
private void |
printCopyrightInformation()
Prints the OpenCms copyright information to all log-files. |
private void |
requestAuthorization(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
This method sends a request to the client to display a login form. |
private void |
throwInitException(javax.servlet.ServletException cause)
Throws a servlet exception that is also logged and written to the error output console. |
private void |
updateUser(com.opencms.file.CmsObject cms,
I_CmsRequest cmsReq)
Updates the the user data stored in the CmsCoreSession after the requested document is processed. |
| Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
| Methods inherited from class javax.servlet.GenericServlet |
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
C_PROPERTY_REDIRECT
static final java.lang.String C_PROPERTY_REDIRECT
- The name of the redirect entry in the configuration file.
- See Also:
- Constant Field Values
C_PROPERTY_REDIRECTLOCATION
static final java.lang.String C_PROPERTY_REDIRECTLOCATION
- The name of the redirect location entry in the configuration file.
- See Also:
- Constant Field Values
m_configurations
private source.org.apache.java.util.Configurations m_configurations
- The configuration for the OpenCms servlet.
m_sessionStorage
private CmsCoreSession m_sessionStorage
- The session storage for all active users.
m_opencms
private OpenCms m_opencms
- The reference to the OpenCms system.
m_clusterurl
private java.lang.String m_clusterurl
- Storage for the clusterurl.
m_UseBasicAuthentication
private boolean m_UseBasicAuthentication
- Flag to indicate if basic or form based authentication is used.
m_AuthenticationFormURI
private java.lang.String m_AuthenticationFormURI
- URI of the authentication form (read from properties).
DEBUG
private static final boolean DEBUG
- Flag for debugging.
- See Also:
- Constant Field Values
C_ERRORMSG
private static final java.lang.String C_ERRORMSG
- Prefix for error messages for initialization errors.
- See Also:
- Constant Field Values
| Constructor Detail |
OpenCmsHttpServlet
public OpenCmsHttpServlet()
| Method Detail |
printCopyrightInformation
private void printCopyrightInformation()
- Prints the OpenCms copyright information to all log-files.
throwInitException
private void throwInitException(javax.servlet.ServletException cause) throws javax.servlet.ServletException
- Throws a servlet exception that is also logged and written to the error output console.
init
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
- Initialization of the OpenCms servlet (overloaded Servlet API method).
The connection information for the database is read from the
opencms.propertiesconfiguration file and all resource brokers are initialized via the initalizer, which usually will be an instance of aOpenCmsclass.- Specified by:
initin interfacejavax.servlet.Servlet
destroy
public void destroy()
- Destroys all running threads before closing the VM.
- Specified by:
destroyin interfacejavax.servlet.Servlet
doGet
public void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws javax.servlet.ServletException, java.io.IOException
- Method invoked on each HTML GET request.
(Overloaded Servlet API method, requesting a document). Reads the URI received from the client and invokes the appropiate action.
doPost
public void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws javax.servlet.ServletException, java.io.IOException
- Method invoked on each HTML POST request.
(Overloaded Servlet API method, posting a document) The OpenCmsMultipartRequest is invoked to upload a new document into OpenCms.
createErrorBox
private java.lang.String createErrorBox(CmsException e, com.opencms.file.CmsObject cms)
- Generates a formated exception output.
Because the exception could be thrown while accessing the system files, the complete HTML code must be added here!
errorHandling
private void errorHandling(com.opencms.file.CmsObject cms, I_CmsRequest cmsReq, I_CmsResponse cmsRes, CmsException e)
- This method performs the error handling for the OpenCms.
All CmsExetions throns in the OpenCms are forwared to this method and are
processed here.
initUser
private com.opencms.file.CmsObject initUser(I_CmsRequest cmsReq, I_CmsResponse cmsRes) throws java.io.IOException
- This method handled the user authentification for each request sent to the
OpenCms.
User authentification is done in three steps:
- Session Authentification: OpenCms stores all active sessions of authentificated users in an internal storage. During the session authetification phase, it is checked if the session of the active user is stored there.
- HTTP Autheification: If session authentification fails, it is checked if the current user has loged in using HTTP authentification. If this check is positive, the user account is checked.
- Default user: When both authentification methods fail, the current user is set to the default (guest) user.
requestAuthorization
private void requestAuthorization(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws java.io.IOException
- This method sends a request to the client to display a login form.
It is needed for HTTP-Authentification.
updateUser
private void updateUser(com.opencms.file.CmsObject cms, I_CmsRequest cmsReq) throws java.io.IOException
- Updates the the user data stored in the CmsCoreSession after the requested document
is processed.
This is required if the user data (current group or project) was changed in the requested document.
The user data is only updated if the user was authenticated to the system.
getErrormsg
public java.lang.String getErrormsg(java.lang.String part)
- Get the value for the property entry
|
|||||||||
| Home >> All >> com >> opencms >> [ core overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC