Package DE_EPAGES::WebInterface::Servlet::BaseServlet
Provides basic functionality for handling of HTTP requests.
Functions
handle
Initializes request and response and calls handleRequest.
Syntax |
$Servlet->handle($Request, $Response); |
Input |
|
handleRequest
Main function for handling the request. This method must be overloaded by any sub class. The overloaded method should use request and response to access the current request and response objects.
Syntax |
$Servlet->handleRequest; |
init
Initializes the servlet for a new request with parameters from the Servlet.conf configuration file.
Syntax |
$Servlet->init( $hParams ); |
Input |
|
new
Create a new servlet object.
Syntax |
$Servlet = new DE_EPAGES::Presentation::Servlet::Permission; |
Example |
my $Servlet = DE_EPAGES::WebInterface::Servlet::BaseServlet->new; |
Return |
|
redirect
Redirects the browser to another URL.
Syntax |
$Servlet->redirect( $Location ); $Servlet->redirect( $Location, $StatusCode ); |
Input |
|
request
Return the current request. This function must be called during the handleRequest method, otherwise it returns undef.
Syntax |
$Request = $Servlet->request; |
Example |
my $Request = $Servlet->request; |
Return |
|
requestHeaders
Without parameter returns all HTTP request headers as hash ref.
With one parameter returns the value of one request header.
Syntax |
$hHeaders = $Servlet->requestHeaders; $Value= $Servlet->requestHeaders($Name); |
Input |
|
Return |
|
response
Return the current response. This function must be called during the handleRequest method, otherwise it returns undef.
Syntax |
$Response = $Servlet->response; |
Example |
my $Response = $Servlet->response; |
Return |
|
serverVariables
Without parameter returns the function cookies which was served by the
request. On first run on servlet the form will be encoded.
With one parameter (name of server variable) the value of this key will be
returned.
Syntax |
$ServerVariables = $Servlet->serverVariables; $ServerVariable = $Servlet->serverVariables($Name); |
Input |
|
Return |
|
storeName
Returns the store name from the X-ePages-Store header. Returns undef if the header doe not exist.
Syntax |
$Servlet->storeName; |