com.groiss.gui
Class VelocityPage

java.lang.Object
  extended by com.groiss.gui.VelocityPage
All Implemented Interfaces:
Page

public class VelocityPage
extends java.lang.Object
implements Page

Page implementation which can handle Velocity-templates
following objects may be used in the context by default and may not be used in set(String, Object)

See Also:
Apache Velocity

Constructor Summary
VelocityPage()
          if you use this constructor, you have to call setTemplate(String)
VelocityPage(java.lang.String resource)
          loads the given template.
 
Method Summary
 java.lang.String getContentType()
          Returns the content type of the page, for example "test/html".
 void set(java.lang.String name, java.lang.Object obj)
          adds the given object to the VelocityContext
 void setContentType(java.lang.String contentType)
          set the contenttype
 void setTemplate(java.lang.String template)
          set the velocity-template
 java.lang.String show()
          Called from the Dispatcher.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VelocityPage

public VelocityPage()
if you use this constructor, you have to call setTemplate(String)


VelocityPage

public VelocityPage(java.lang.String resource)
loads the given template. the Resource to use will be determined automatically

Parameters:
resource - the velocity template
Method Detail

set

public void set(java.lang.String name,
                java.lang.Object obj)
adds the given object to the VelocityContext

Parameters:
name - variable name
obj - object

show

public java.lang.String show()
Description copied from interface: Page
Called from the Dispatcher. Returns a String representation suitable for viewing in the browser (HTML, XHTML, plain text, etc.)

Specified by:
show in interface Page

getContentType

public java.lang.String getContentType()
Description copied from interface: Page
Returns the content type of the page, for example "test/html".

Specified by:
getContentType in interface Page
Returns:
the contents mime type as String

setTemplate

public void setTemplate(java.lang.String template)
set the velocity-template

Parameters:
template - a string containing velocity-syntax

setContentType

public void setContentType(java.lang.String contentType)
set the contenttype

Parameters:
contentType - the contenttype


@enterprise 8.0.22989 Copyright © 2001-2017 Groiss Informatics GmbH. All Rights Reserved.