[ 
http://www.stripesframework.org/jira/browse/STS-607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11527#action_11527
 ] 

Frederic Daoud commented on STS-607:
------------------------------------

Sorry, hit submit by mistake and I can't edit the previous comment.

This would be a one-liner to fix:

Index: stripes/src/net/sourceforge/stripes/ajax/JavaScriptBuilder.java
===================================================================
--- stripes/src/net/sourceforge/stripes/ajax/JavaScriptBuilder.java     
(revision 974)
+++ stripes/src/net/sourceforge/stripes/ajax/JavaScriptBuilder.java     
(working copy)
@@ -399,7 +399,7 @@
                 if ((readMethod != null) && 
!this.excludeProperties.contains(fullPropertyName)) {
                     Object value = property.getReadMethod().invoke(in);
 
-                    if (isExcludedType(property.getPropertyType()) || value == 
null) {
+                    if (isExcludedType(property.getPropertyType())) {
                         continue;
                     }

And would produce the output as in the example from my previous comment.

However, would this break existing applications? Do applications rely on the 
non-presence of properties that are null in the JavaScriptResolution, as 
opposed to their presence with a value of null?


> JavaScriptResolution ignores properties with null values
> --------------------------------------------------------
>
>                 Key: STS-607
>                 URL: http://www.stripesframework.org/jira/browse/STS-607
>             Project: Stripes
>          Issue Type: Bug
>    Affects Versions: Release 1.5
>         Environment: Windows XP, Eclipse Ganymede, Java 1.6, Tomcat, Firefox
>            Reporter: David Frenkiel
>            Assignee: Frederic Daoud
>
> JavaScriptResolution skips null valued properties. So if you try to access 
> those properties in javascript you get an error.
> For example, if I have an Address object:
> public class Address() {
>     private String street1 = "123 Main Street";
>     private String street2 = null;
>     // getters/setters, etc...
> }
> Then in javascript, after retrieving an Address object:
>     alert(address.street1) properly displays "123 Main Street"
> whereas
>     alert(address.street2) results in the error, "address.street2 is 
> undefined."
> P.S...
> Stripes is great. I'm migrating away from XWork/WebWork/Velocity and Stripes 
> is way, way, way better.
> Thanks.
> David F.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://www.stripesframework.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to