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.
 
Authorizerauthorizer ()
 Returns the authorizer.
 
void detach ()
 Detach from server.
 
bool isIdle ()
 Returns true if not in use.
 
bool isMapped (const Request &request) const
 Returns true if request is mapped to the service.
 
Serviceservice ()
 Returns the service to map requests to.
 
void setShutdown (bool shutdown=true)
 Set shutdown flag.
 

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.