1#ifndef __DCL_HTTP_SERVLET_H__
2#define __DCL_HTTP_SERVLET_H__ 20050530
5#ifndef __DCL_OBJECT_H__
9#ifndef __DCL_EXCEPTION_H__
16#ifndef __DCL_HTTP_SERVER_EXTENSION_H__
19#ifndef __DCL_HTTP_HEADER_H__
44 String remoteAddr()
const;
45 unsigned int remotePort()
const;
46 String method()
const;
47 unsigned int methodNo()
const;
49 String queryString()
const;
50 String contentType()
const;
51 size_t contentLength()
const;
52 String scriptFilename()
const;
53 String scriptData()
const;
55 const String& resContentType()
const;
57 ByteString getHttpHeader(
const char* _name =
NULL)
const;
58 ByteString getCgiVariable(
const char* _name =
NULL)
const;
59 String getHttpHeader(
const wchar_t* _name =
NULL)
const;
60 String getCgiVariable(
const wchar_t* _name =
NULL)
const;
65 void setStatusCode(
unsigned int uHttpStatusCode);
66 void setContentType(
const wchar_t* _contentType,
const wchar_t* pszCharset =
NULL);
87 String getIniFileName(
const wchar_t* _basename =
NULL)
const;
125#define HTTP_SERVLET_INSTANCE(ServletClass, Description) \
126static HttpServlet* __servlet__ = NULL; \
127static BOOL ModuleInitialize( \
128 const DCL_HTTP_SERVLET_CONFIG* pConfig, \
132 __servlet__ = new ServletClass; \
133 if (!__servlet__) { \
134 pConfig->pSAPI->pfnReportError( \
141 if (!HttpServlet::__initialize( \
147 delete __servlet__; \
148 __servlet__ = NULL; \
155static BOOL ModuleCleanup( \
159 BOOL bResult = HttpServlet::__cleanup( \
163 delete __servlet__; \
164 __servlet__ = NULL; \
168static BOOL ModuleHttpService( \
169 const DCL_HTTP_SERVLET_CONTEXT* pContext, \
173 return HttpServlet::__httpService( \
182DCL_HTTP_SERVLET DCL_DSO_ENTRY_POINT = { \
183 sizeof(DCL_HTTP_SERVLET), \
185 __T(__TIMESTAMP__), \
187 DCL_HTTP_SERVLET_MODULE, \
189 DCL_HTTP_SERVER_VERSION, \
struct _DCL_HTTP_SERVLET_CONTEXT DCL_HTTP_SERVLET_CONTEXT
struct _DCL_HTTP_SERVER_API DCL_HTTP_SERVER_API
struct _DCL_HTTP_SERVLET_CONFIG DCL_HTTP_SERVLET_CONFIG
#define DECLARE_CLASSINFO(class_name)
void CharsetConvertException *size_t n
const DCL_HTTP_SERVLET_CONTEXT * __context
unsigned int __statusCode
const DCL_HTTP_SERVER_API * __SAPI
StringBuilder __responseHeaders
static bool __cleanup(HttpServlet *_servlet, void *hErrorReport)
virtual void onInitialize() __DCL_THROWS1(Exception *)
static bool __httpService(HttpServlet *_servlet, const DCL_HTTP_SERVLET_CONTEXT *_context, void *hErrorReport)
virtual void onHttpService(const DCL_HTTP_SERVLET_CONTEXT *pContext)=0__DCL_THROWS1(Exception *)
const DCL_HTTP_SERVER_API * __SAPI
const wchar_t * __moduleName
const wchar_t * __configPath
virtual void onCleanup() __DCL_THROWS1(Exception *)
const wchar_t * __tempPath
static bool __initialize(HttpServlet *_servlet, const DCL_HTTP_SERVLET_CONFIG *_config, void *hErrorReport)