ParameterParser Reference Documentation
View tool for easy parsing of ServletRequest parameters.
@@@version@@@, @@@date@@@org.apache.velocity.tools.view.tools.ParameterParser$paramsNathan Bubna<tool>
<key>params</key>
<scope>request</scope>
<class>org.apache.velocity.tools.view.tools.ParameterParser</class>
</tool>
exists()
Returns true
if a parameter for the specified key exists.
boolean exists(String key)
The key of the parameter in question
true
if a parameter for the specified key exists or
false
if this parameter is not present or has no value.
getString()
Returns the specified servlet request parameter as a String
String get(String key)
String getString(String key)
String getString(String key, String alternate)
The key of the desired string parameter
An alternate value
The value of the parameter matching the specified key or the
specified alternate String if there is no matching parameter.
A value of null
is returned if no alternate value
is defined and the desired parameter is not found.
getBoolean()
Returns the specified servlet request parameter as a Boolean object or
a boolean primitive type
Boolean getBoolean(String key)
Boolean getBoolean(String key, Boolean alternate)
boolean getBoolean(String key, boolean alternate)
The key of the desired string parameter
An alternate value
A Boolean object or boolean primitive type that represents the
value of the servlet request parameter matching the specified key
or the specified alternate boolean if there is no matching parameter.
A value of null
is returned if no alternate value
is defined and the desired parameter is not found.
getNumber()
Returns the specified servlet request parameter as a Number object
Number getNumber(String key)
Number getNumber(String key, Number alternate)
The key of the desired string parameter
An alternate value
A java.lang.Number
object that represents the
value of the servlet request parameter matching the specified key
or the specified alternate Number if there is no matching parameter.
A value of null
is returned if no alternate value
is defined and the desired parameter is not found.
getInt()
Returns the specified servlet request parameter as an integer
int getInt(String key, int alternate)
The key of the desired string parameter
An alternate value
An integer that represents the
value of the servlet request parameter matching the specified key
or the specified alternate value if there is no matching parameter.
getDouble()
Returns the specified servlet request parameter as a double
double getDouble(String key, double alternate)
The key of the desired string parameter
An alternate value
An double that represents the
value of the servlet request parameter matching the specified key
or the specified alternate value if there is no matching parameter.
getStrings()
Returns an array of Strings of all the values of the specified servlet
request parameter
String[] getStrings(String key)
The key of the desired string parameter
A array of Strings that represent all the values of the desired
request parameter or null
if the parameter does not
exist.
getBooleans()
Returns an array of Booleans of all the values of the specified servlet
request parameter
Boolean[] getBooleans(String key)
The key of the desired string parameter
A array of java.lang.Boolean
that represent all the
values of the desired request parameter or null
if
the parameter does not exist.
getNumbers()
Returns an array of Numbers of all the values of the specified servlet
request parameter
Number[] getNumbers(String key)
The key of the desired string parameter
A array of java.lang.Number
that represent all the
values of the desired request parameter or null
if
the parameter does not exist.
getInts()
Returns an array of integers of all the values of the specified servlet
request parameter
int[] getInts(String key)
The key of the desired string parameter
A array of integer primitive types that represent all the
values of the desired request parameter or null
if
the parameter does not exist.
getDoubles()
Returns an array of doubles of all the values of the specified servlet
request parameter
double[] getDoubles(String key)
The key of the desired string parameter
A array of double primitive types that represent all the
values of the desired request parameter or null
if
the parameter does not exist.