tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Frericks (JIRA)" <tapestry-...@jakarta.apache.org>
Subject [jira] Created: (TAPESTRY-218) Persistent properties cant be set to null
Date Tue, 26 Oct 2004 07:05:43 GMT
Persistent properties cant be set to null 
------------------------------------------

         Key: TAPESTRY-218
         URL: http://issues.apache.org/jira/browse/TAPESTRY-218
     Project: Tapestry
        Type: Bug
  Components: Framework  
    Versions: 3.0    
 Environment: IBM WebSphere 4
    Reporter: Michael Frericks


situation:

If you set a persistent property to null, this finally invokes

SessionPageRecorder#recordChange
...
        _session.setAttribute(attributeKey, newValue);
...

where newValue is null.

The ServletAPI 2.2 says:

        newValue - the object to be bound; cannot be null

So we tested and saw that the IBM WebSphere 4 really did not
accept the null value and the propety was not changed.
That is ugly.


solution:
Change 
SessionPageRecorder#recordChange

...
        _session.setAttribute(attributeKey, newValue);
...

to 
        if(newValue != null)
        {
          _session.setAttribute(attributeKey, newValue);
        }
        else
        {
          _session.removeAttribute(attributeKey);
        }




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


Mime
View raw message