|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.melati.servlet.Form
public final class Form
An object to hold useful static methods for manipulation of a Form in a
ServletTemplateContext.
| Method Summary | |
|---|---|
static java.lang.Object |
extractField(ServletTemplateContext context,
java.lang.String fieldName)
Fill in value of a Field from a ServletTemplateContext. |
static void |
extractFields(ServletTemplateContext context,
Persistent object)
Retrieve updated persistent fields from a context modified in a template. |
static java.lang.Boolean |
getBooleanField(ServletTemplateContext context,
java.lang.String field)
A utility method that tests whether a field is present in a Form, returning a Boolean. |
static java.lang.String |
getField(ServletTemplateContext context,
java.lang.String field,
java.lang.String defaultValue)
A utility method that gets a value from the Form. |
static java.lang.String |
getFieldNulled(ServletTemplateContext context,
java.lang.String field)
A utility method that gets a value from the Form. |
static java.lang.String |
getForm(ServletTemplateContext context,
java.lang.String field,
java.lang.String def)
A utility method that gets a value from the Form. |
static java.lang.String |
getFormNulled(ServletTemplateContext context,
java.lang.String field)
A utility method that gets a value from the Form. |
static java.lang.Integer |
getIntegerField(ServletTemplateContext context,
java.lang.String field)
A utility method that gets a value from the Form as an Integer. |
static java.lang.Integer |
getIntegerField(ServletTemplateContext context,
java.lang.String field,
java.lang.Integer defaultValue)
A utility method that gets a value from the Form as an Integer. |
static java.lang.String |
sameQueryWith(java.lang.String qs,
java.lang.String field,
java.lang.String value)
Modify or add a form parameter setting (query string component) in a query string. |
static java.lang.String |
sameURLWith(javax.servlet.http.HttpServletRequest request,
java.lang.String field,
java.lang.String value)
Modify or add a form parameter setting (query string component) in the URL for a servlet request. |
static java.lang.String |
sameURLWith(java.lang.String uri,
java.lang.String query,
java.lang.String field,
java.lang.String value)
Modify or add a form parameter setting (query string component) in a URL. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void extractFields(ServletTemplateContext context,
Persistent object)
The context can specify an adaptor for each field using another HTML
field with name suffix "-adaptor" and value the classname of
a TempletAdaptor.
Hence the templet that renders the field can specify how
the result is parsed.
This is currently used for dates.
context - the current ServletTemplateContext to get values fromobject - the Persistent to update
public static java.lang.Object extractField(ServletTemplateContext context,
java.lang.String fieldName)
throws TempletAdaptorConstructionMelatiException
context - the current ServletTemplateContext to get values fromfieldName - the name of the field to extract
TempletAdaptorConstructionMelatiException - if there is a problem, for example with the class name
public static java.lang.String getFieldNulled(ServletTemplateContext context,
java.lang.String field)
context - - a template contextfield - - the name of the field to get
public static java.lang.String getField(ServletTemplateContext context,
java.lang.String field,
java.lang.String defaultValue)
context - - a template contextfield - - the name of the field to getdefaultValue - - the default value if the field is "" or not present
public static java.lang.Integer getIntegerField(ServletTemplateContext context,
java.lang.String field,
java.lang.Integer defaultValue)
context - - a template contextfield - - the name of the field to getdefaultValue - - the default value if the field is "" or not present
public static java.lang.Integer getIntegerField(ServletTemplateContext context,
java.lang.String field)
context - - a template contextfield - - the name of the field to get
public static java.lang.Boolean getBooleanField(ServletTemplateContext context,
java.lang.String field)
context - - a template contextfield - - the name of the field to get
public static java.lang.String sameURLWith(java.lang.String uri,
java.lang.String query,
java.lang.String field,
java.lang.String value)
uri - A URIquery - A query stringfield - The parameter's namevalue - The new value for the parameter (unencoded)
public static java.lang.String sameURLWith(javax.servlet.http.HttpServletRequest request,
java.lang.String field,
java.lang.String value)
request - A servlet requestfield - The parameter's namevalue - The new value for the parameter (unencoded)
public static java.lang.String sameQueryWith(java.lang.String qs,
java.lang.String field,
java.lang.String value)
qs - A query stringfield - The parameter's namevalue - The new value for the parameter (unencoded)
public static java.lang.String getFormNulled(ServletTemplateContext context,
java.lang.String field)
context - - a template contextfield - - the name of the field to get
public static java.lang.String getForm(ServletTemplateContext context,
java.lang.String field,
java.lang.String def)
context - - a template contextfield - - the name of the field to getdef - - the default value if the field is "" or not present
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||