[gatein-issues] [JBoss JIRA] (GTNPORTAL-2373) groovy template should not print "null" string when variable is null

Trong Tran (JIRA) jira-events at lists.jboss.org
Thu Oct 11 05:42:03 EDT 2012


    [ https://issues.jboss.org/browse/GTNPORTAL-2373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12725526#comment-12725526 ] 

Trong Tran commented on GTNPORTAL-2373:
---------------------------------------

printing "null" is an expected behavior from Groovy template engine world. I don't really like to change this default behavior ( And I can see that JSP syntax does the same. )

For me, the proper fix is to check non-NULL value before printing if we don't want to write "null". So I prefer to take "Won't Fix" for this.

WDYT ?
                
> groovy template should not print "null" string when variable is null
> --------------------------------------------------------------------
>
>                 Key: GTNPORTAL-2373
>                 URL: https://issues.jboss.org/browse/GTNPORTAL-2373
>             Project: GateIn Portal
>          Issue Type: Enhancement
>      Security Level: Public(Everyone can see) 
>            Reporter: kien nguyen
>            Assignee: kien nguyen
>            Priority: Minor
>              Labels: portal-s68, worked
>             Fix For: 3.5.0.Beta01
>
>         Attachments: GTNPORTAL-2373.patch
>
>   Original Estimate: 2 hours
>  Remaining Estimate: 2 hours
>
> In .gtmpl file, I use: <input class="key" type="text" name="key" value="${key}"/>
> And if "key" variable is null, I will get "null" string in input like: <input type="text" name="key" value="null">
> I think it should not be, we should print nothing when variable is null, for example: <input type="text" name="key" value>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the gatein-issues mailing list