You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Musachy Barroso (JIRA)" <ji...@apache.org> on 2007/05/19 03:28:42 UTC

[jira] Resolved: (WW-1830) Support non-String attributes to freemarker JSP tag extensions

     [ https://issues.apache.org/struts/browse/WW-1830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Musachy Barroso resolved WW-1830.
---------------------------------

    Resolution: Fixed

Fixed applying patch from webwork rev 2866

> Support non-String attributes to freemarker JSP tag extensions
> --------------------------------------------------------------
>
>                 Key: WW-1830
>                 URL: https://issues.apache.org/struts/browse/WW-1830
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Views
>    Affects Versions: 2.0.6
>            Reporter: Jasper Rosenberg
>             Fix For: 2.0.8
>
>
> The full issue and the suggested patch is outlined in this forum post: http://forums.opensymphony.com/message.jspa?messageID=133951
> Here is the original root issue:
> ---------------------------------------------------
> In the docs, it describes being able to pass a parameter directly to the tag rather than via a a nested param tag (http://struts.apache.org/2.x/docs/freemarker-tags.html):
> <@s.textfield label="First name" name="firstName" description="..."/>
> This works great for Strings, but I can't figure out a way to have it work for booleans.
> For example, I added a parameter to controlheader-core.ftl: "excludecolon" so I can hide the colon after the label (for labels that are questions).
> <#if !parameters.excludecolon?default(false)>:</#if><#t/>
> If I pass it via a tag:
> <@s.param name="excludecolon" value="true"/>
> Everything works great.
> However, if I try to pass it as an attribute, excludecolon="true", it is interpreted as a String, and my freemarker template blows up. 
> None of the following work:
> <@s.textfield ...... excludecolon=true/>
> <@s.textfield ...... excludecolon="true"/>
> <#assign someVar=true />
> <@s.textfield ...... excludecolon=someVar/>
> <#assign someVar=true />
> <@s.textfield .... executecolon="${someVar}" />

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.