Am a newbie to Java & Restlet.
Am writing a function to get the post params and calls another function internally.
My doubt is if my code is something like this:
Form form = new Form(entity);
String abc = form.getFirstValue("abc");
And if the param abc is not passed, what would be the exception or what would be stored in abc?
I found this source code: Series. Your Form class extends this Series class.
If parameter 'abc' not exists, then null (defaultValue) will be returned:
public String getFirstValue(String name) {
return getFirstValue(name, false);
}
public String getFirstValue(String name, boolean ignoreCase) {
return getFirstValue(name, ignoreCase, null);
}
public String getFirstValue(String name, boolean ignoreCase, String defaultValue) {
String result = defaultValue;
NamedValue<String> param = getFirst(name, ignoreCase);
if ((param != null) && (param.getValue() != null)) {
result = param.getValue();
}
return result;
}