org.melati.template.webmacro
Class WebmacroServletTemplateContext

Package class diagram package WebmacroServletTemplateContext
java.lang.Object
  extended by org.melati.template.webmacro.WebmacroTemplateContext
      extended by org.melati.template.webmacro.WebmacroServletTemplateContext
All Implemented Interfaces:
ServletTemplateContext, TemplateContext

public class WebmacroServletTemplateContext
extends WebmacroTemplateContext
implements ServletTemplateContext

Implements a template context for Melati using Webmacro.

Author:
Tim Joyce

Field Summary
 org.webmacro.servlet.WebContext webContext
          The webcontext.
 
Constructor Summary
WebmacroServletTemplateContext(org.webmacro.Context wc)
          Constructor.
 
Method Summary
 String getFormField(String k)
          Returns null if not present, empty string if empty.
 MultipartFormField getMultipartFormField(String s)
          Throws an exception as this is not a multi part form.
 javax.servlet.http.HttpSession getSession()
          Get the HttpSession .
 
Methods inherited from class org.melati.template.webmacro.WebmacroTemplateContext
get, getContext, put, setPassbackExceptionHandling, setPropagateExceptionHandling
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.melati.template.TemplateContext
get, getContext, put, setPassbackExceptionHandling, setPropagateExceptionHandling
 

Field Detail

webContext

public org.webmacro.servlet.WebContext webContext
The webcontext.

Constructor Detail

WebmacroServletTemplateContext

public WebmacroServletTemplateContext(org.webmacro.Context wc)
Constructor.

Parameters:
wc - WebMacro context
Method Detail

getFormField

public String getFormField(String k)
Returns null if not present, empty string if empty. Get a field from an HTML Form.

Specified by:
getFormField in interface ServletTemplateContext
Parameters:
k - the field's name
Returns:
the field value, null if not set
See Also:
org.melati.template.ServletTemplateContext#getForm(java.lang.String)

getMultipartFormField

public MultipartFormField getMultipartFormField(String s)
Throws an exception as this is not a multi part form. Should perhaps throw an exception.

Specified by:
getMultipartFormField in interface ServletTemplateContext
Parameters:
s - the field's name
Returns:
the field's value
See Also:
org.melati.template.ServletTemplateContext#getMultipartForm(java.lang.String)

getSession

public javax.servlet.http.HttpSession getSession()
Get the HttpSession .

Specified by:
getSession in interface ServletTemplateContext
Returns:
the current HttpSession
See Also:
ServletTemplateContext.getSession()


Copyright © 2000-2010 PanEris. All Rights Reserved.