|
||||||||||
| 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 void |
extractFields(ServletTemplateContext context,
Persistent object)
Retrieve updated persistent fields from a context modified in a template. |
static Boolean |
getBooleanField(ServletTemplateContext context,
String field)
A utility method that tests whether a field is present in a Form, returning a Boolean. |
static String |
getField(ServletTemplateContext context,
String field,
String defaultValue)
A utility method that gets a value from the Form. |
static String |
getFieldNulled(ServletTemplateContext context,
String field)
A utility method that gets a value from the Form. |
static Integer |
getIntegerField(ServletTemplateContext context,
String field)
A utility method that gets a value from the Form as an Integer. |
static Integer |
getIntegerField(ServletTemplateContext context,
String field,
Integer defaultValue)
A utility method that gets a value from the Form as an Integer. |
static String |
sameQueryWith(String qs,
String field,
String value)
Modify or add a form parameter setting (query string component) in a query string. |
static String |
sameURLWith(javax.servlet.http.HttpServletRequest request,
String field,
String value)
Modify or add a form parameter setting (query string component) in the URL for a servlet request. |
static String |
sameURLWith(String uri,
String query,
String field,
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 frompersistent - the Persistent to update
public static String getFieldNulled(ServletTemplateContext context,
String field)
context - - a template contextfield - - the name of the field to get
public static String getField(ServletTemplateContext context,
String field,
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 Integer getIntegerField(ServletTemplateContext context,
String field,
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 Integer getIntegerField(ServletTemplateContext context,
String field)
context - - a template contextfield - - the name of the field to get
public static Boolean getBooleanField(ServletTemplateContext context,
String field)
context - - a template contextfield - - the name of the field to get
public static String sameURLWith(String uri,
String query,
String field,
String value)
uri - A URIquery - A query stringfield - The parameter's namevalue - The new value for the parameter (unencoded)
public static String sameURLWith(javax.servlet.http.HttpServletRequest request,
String field,
String value)
request - A servlet requestfield - The parameter's namevalue - The new value for the parameter (unencoded)
public static String sameQueryWith(String qs,
String field,
String value)
qs - A query stringfield - The parameter's namevalue - The new value for the parameter (unencoded)
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||