The method below can be used in a Servlet to check if a field is present in the request object. Which means it can be used to check if the form or the page that posted to your current Servlet, contains the required field or not.
Java Code:
public isDefined(HttpServletRequest req, String fieldNameToSearchFor) {
return req.getParameterMap().containsKey(fieldNameToSearchFor);