com.groiss.gui
Class HTMLPage

java.lang.Object
  extended by com.groiss.gui.HTMLPage
All Implemented Interfaces:
Page, java.io.Serializable
Direct Known Subclasses:
ActionPage, HTMLTree

public class HTMLPage
extends java.lang.Object
implements Page, java.io.Serializable

See Also:
Serialized Form

Field Summary
protected  java.lang.String contentType
           
protected  java.lang.String page
           
 
Constructor Summary
HTMLPage()
          This class can be used to construct HTML pages from templates and values.
HTMLPage(java.lang.String resource)
          Creates a HTMLPage with a content loaded from a file in classpath.
HTMLPage(java.lang.String resource, Resource res)
          Creates a HTMLPage with a content loaded from a file in classpath.
 
Method Summary
 java.lang.String getContentType()
          This method returns the content type.
 void setContentType(java.lang.String type)
          Set the content type.
 void setMask(java.lang.String s)
          Deprecated.  
 HTMLPage setPage(java.lang.String s)
          Set the content of the page.
 java.lang.String show()
          This method returns the page contents.
 void substEncoded(java.lang.String field, java.lang.String value)
          Substitutes the field named by the first argument with the second argument.
 void substitute(java.lang.String field, long value)
          Substitutes the field named by the first argument with the second argument.
 void substitute(java.lang.String field, java.lang.Object value)
          Substitutes the field named by the first argument with the second argument.
 void substitute(java.lang.String field, java.lang.String value)
          Substitutes the field named by the first argument with the second argument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

page

protected java.lang.String page

contentType

protected java.lang.String contentType
Constructor Detail

HTMLPage

public HTMLPage()
This class can be used to construct HTML pages from templates and values.


HTMLPage

public HTMLPage(java.lang.String resource)
Creates a HTMLPage with a content loaded from a file in classpath.


HTMLPage

public HTMLPage(java.lang.String resource,
                Resource res)
Creates a HTMLPage with a content loaded from a file in classpath.

Method Detail

setPage

public HTMLPage setPage(java.lang.String s)
Set the content of the page.

Parameters:
s - the content of the page

substitute

public void substitute(java.lang.String field,
                       java.lang.String value)
Substitutes the field named by the first argument with the second argument.

Parameters:
field - the place-holder
value - the value to be inserted

substEncoded

public void substEncoded(java.lang.String field,
                         java.lang.String value)
Substitutes the field named by the first argument with the second argument. The value will be html-encoded.

Parameters:
field - the place-holder
value - the value to be inserted

substitute

public void substitute(java.lang.String field,
                       long value)
Substitutes the field named by the first argument with the second argument.

Parameters:
field - the place-holder
value - the value to be inserted

substitute

public void substitute(java.lang.String field,
                       java.lang.Object value)
Substitutes the field named by the first argument with the second argument.

Parameters:
field - the place-holder
value - the value to be inserted, toString is called on the object.

show

public java.lang.String show()
This method returns the page contents.

Specified by:
show in interface Page

getContentType

public java.lang.String getContentType()
This method returns the content type. If not set, the value "text/html" is returned.

Specified by:
getContentType in interface Page
Returns:
the content type of the page.

setContentType

public void setContentType(java.lang.String type)
Set the content type.

Parameters:
type - the content type, for example "text/plain"

setMask

@Deprecated
public void setMask(java.lang.String s)
Deprecated. 

Set the mask template of the page. This method does the same as setPage() and is provided for compatibility.

Parameters:
s - the template of the page


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