Re: booleans
Attila Szegedi <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <CAMYVXdsH_fnEqDdb+DzLohunEJR1_FAGRfEs2QOPLZQXW+wdvA@mail.gmail.com> |
That's by design for booleans; use ${bug.resolved?string}. See
<http://fmpp.sourceforge.net/freemarker/ref_builtins_boolean.html> for
details.
On Mon, Jul 2, 2012 at 1:13 AM, S Ahmed <[email protected]> wrote:
> (IntelliJ creates these properties for me using its code generation)
>
> I changed my view code from bug.isResolved to bug.resolved, still getting an
> error....
>
> Bug.java:
>
> public boolean isResolved() {
> return isResolved;
> }
>
> public void setResolved(boolean resolved) {
> isResolved = resolved;
> }
>
> .ftl:
>
> ${bug.resolved}
>
>
> I'm getting this error:
>
> org.springframework.web.util.NestedServletException: Request processing
> failed; nested exception is freemarker.core.NonStringException: Error on
> line 4, column 47 in bugs/show.ftl
> Expecting a string, date or number here, Expression bug.resolved is instead
> a freemarker.template.TemplateBooleanModel$1
> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)
> org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/