org.liquidsite.app.template
Class RequestBean

java.lang.Object
  extended byorg.liquidsite.app.template.TemplateBean
      extended byorg.liquidsite.app.template.RequestBean

public class RequestBean
extends TemplateBean

A request bean. This class is used to access the request object from the templates.


Nested Class Summary
 class RequestBean.RequestHeaderBean
          A request header bean.
 class RequestBean.RequestParameterBean
          A request parameter bean.
 
Method Summary
 freemarker.template.TemplateHashModel getHeader()
          Returns a map with all the request header names and values.
 java.lang.String getIp()
          Returns the remote IP address.
 freemarker.template.TemplateHashModel getParam()
          Returns a map with all the request parameter names and values.
 java.lang.String getPath()
          Returns the request path.
 java.lang.String getSite()
          Returns the site path.
 java.lang.String getUrl()
          Returns the complete request URL.
 void redirect(java.lang.String location)
          Redirects the users web browser to the specified location.
 void responseMimeType(java.lang.String mimeType)
          Sets the response content MIME type.
 
Methods inherited from class org.liquidsite.app.template.TemplateBean
getContext, getContextRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSite

public java.lang.String getSite()
Returns the site path.

Returns:
the site path

getPath

public java.lang.String getPath()
Returns the request path.

Returns:
the request path

getUrl

public java.lang.String getUrl()
Returns the complete request URL. The URL will NOT include request parameters or similar.

Returns:
the complete request URL

getIp

public java.lang.String getIp()
Returns the remote IP address. This is the IP address from where the request was supposedly sent.

Returns:
the remote IP address

getHeader

public freemarker.template.TemplateHashModel getHeader()
Returns a map with all the request header names and values.

Returns:
the map with request header names and values

getParam

public freemarker.template.TemplateHashModel getParam()
Returns a map with all the request parameter names and values.

Returns:
the map with request parameter names and values

responseMimeType

public void responseMimeType(java.lang.String mimeType)
Sets the response content MIME type. By default the HTML MIME type will be used.

Parameters:
mimeType - the response MIME type

redirect

public void redirect(java.lang.String location)
Redirects the users web browser to the specified location. The location specified may be either a relative or an absolute URL. Note that page processing does not stop after calling this method. Also, a previous redirect may be cancelled by calling this method with an empty string.

Parameters:
location - the new location, or an empty string