Servlet Class Referenceabstract

#include <Pt/Http/Servlet.h>

Servlet for HTTP services. More...

Inherits NonCopyable.

Inherited by MapAny, and MapUrl.

Public Member Functions

 Servlet (Service &s)
 Construct with service.
 
 Servlet (Service &s, Authorizer &a)
 Construct with service and authorizer.
 
virtual ~Servlet ()
 Destructor.
 
void setShutdown (bool shutdown=true)
 Set shutdown flag.
 
bool isIdle ()
 Returns true if not in use.
 
void detach ()
 Detach from server.
 
bool isMapped (const Request &request) const
 Returns true if request is mapped to the service.
 
Serviceservice ()
 Returns the service to map requests to.
 
Authorizerauthorizer ()
 Returns the authorizer.
 

Protected Member Functions

virtual bool onRequest (const Request &request) const =0
 Returns true if the servlet should process the request.
 

Detailed Description

Servlets are used by the HttpServer to map incoming requests to services and to authorize requests. Therefore servlets combine a service with a authorizer and mapping rule. Servlets can be added to a HttpServer.