i want to get parameters values and sometimes i do not send them and it return me null
and its ok . but when i preform check on the return string array the servlet throws a java.lang.NullPointerException
and i just what to do nothing when its null. ( continue the flow )
String[] values = null;
if(request.getParameterValues(fieldName).length>0)
{
values = request.getParameterValues(fieldName);
if(null!=values || values.length>0) // HERE IT throws NullPointerException
{
Collections.addAll(strlist, values);
}
}