When I try storing a null value, like below:
public void processAction(ActionRequest aRequest, ActionResponse aResponse)
throws PortletException, IOException {
//...
PortletPreferences prefs = aRequest.getPreferences();
prefs.setValue("cellPhone", null);
//...
}
An exception occur:
java.lang.NullPointerException
at java.util.prefs.AbstractPreferences.put(AbstractPreferences.java
:224)
at org.apache.jetspeed.om.preference.impl.PrefsPreference.setValueAt
(PrefsPreference.java:138)
at org.apache.jetspeed.om.preference.impl.PrefsPreference.setValues(
PrefsPreference.java:235)
etc...
It occurs only when I try storing a null value. So, I think Jetspeed 2 is
not following the specification correctly, right? The Portlet API docs says:
"The key cannot be null, but null values for the value parameter are
allowed."
Am I missing something, or is Jetspeed 2 really not obeying the rules very
well?