Re: booleans

S Ahmed <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <CAG2rwuNwfDxC=e+ZcPvPx6q01i7CJJ+ZgAUiMxKzM8q_zt9wzQ@mail.gmail.com>
thanks that worked.

On Mon, Jul 2, 2012 at 1:04 AM, Attila Szegedi <[email protected]> wrote:

> 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/
> _______________________________________________
> FreeMarker-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/freemarker-user
>

------------------------------------------------------------------------------
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/

_______________________________________________
FreeMarker-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.