mod_servlet
C++Servlets
|
A servlet configuration object used by a servlet container to pass information to a servlet during initialization. More...
#include <context.h>
Public Member Functions | |
servlet_config (const std::string &servlet_name) | |
Creates new servlet_config object with a given servlet name. More... | |
servlet_config (std::string &&servlet_name) | |
Move version of the object constructor. More... | |
virtual | ~servlet_config () noexcept=default |
Destructor. | |
const std::string & | get_servlet_name () const |
Returns the name of this servlet instance. More... | |
virtual const servlet_context & | get_servlet_context () const =0 |
Returns a reference to the servlet_context in which the caller is executing. More... | |
template<typename KeyType > | |
optional_ref< const std::string > | get_init_parameter (const KeyType &key) const |
Returns a std::string containing the value of the named initialization parameter, or empty_reference if the parameter does not exist. More... | |
const std::map< std::string, std::string, std::less<> > & | get_init_parameters () const |
Returns all the servlet's initialization parameters as a tree_map . More... | |
Protected Attributes | |
const std::string | _servlet_name |
Servlet name. | |
A servlet configuration object used by a servlet container to pass information to a servlet during initialization.
|
inline |
Creates new servlet_config object with a given servlet name.
servlet_name | the name of the servlet. |
|
inline |
Move version of the object constructor.
servlet_name | the name of the servlet |
|
inline |
Returns a std::string
containing the value of the named initialization parameter, or empty_reference if the parameter does not exist.
key | a string specifying the name of the initialization parameter |
std::string
containing the value of the initialization parameter
|
inline |
Returns all the servlet's initialization parameters as a tree_map
.
tree_map
of all the servlet's initialization parameters
|
pure virtual |
Returns a reference to the servlet_context in which the caller is executing.
|
inline |
Returns the name of this servlet instance.
The name may be provided via server administration, assigned in the web application deployment descriptor, or for an unregistered (and thus unnamed) servlet instance it will be the servlet's class name.