|
From: <jer...@xt...> - 2004-07-20 22:17:31
|
I tried the following template:
<#import "/spring.ftl" as spring />
<html>
<body>
<@spring.bind path=3D"command.*">
<#list status.errorMessages as error>
Error code: ${error}<br/>
</#list>
</@spring.bind>
</body>
When the macro @spring.bind is called, I do have the following error:
Error on line 62, column 9 in spring.ftl
springBindStatusHelper.createBindStatus(path, escape) is undefined.
It cannot be assigned to status
The problematic instruction:
----------
=3D=3D> assignment: status=3DspringBindStatusHelper.createBindStatus(path=
,=20
escape) [on line 62, column 9 in spring.ftl]
in user-directive spring.bind [on line 12, column 1 in user.ftl]
----------
Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Error on line 62, column 9 in=20
spring.ftl
springBindStatusHelper.createBindStatus(path, escape) is undefined.
It cannot be assigned to status
at freemarker.core.Assignment.accept(Assignment.java:112)
at freemarker.core.Environment.visit(Environment.java:171)
at freemarker.core.Macro$Context.runMacro(Macro.java:164)
at freemarker.core.Environment.visit(Environment.java:470)
[...]
Have someone been able to use FreeMarkerFormView properly?
Do I need to add something "special" in my configurer for FreeMarker?
TIA,
J=E9r=F4me.
|
|
From: Matt R. <li...@ra...> - 2004-07-20 23:45:48
|
I've got it to work, but only after modifying the build.xml in CVS to
include *.ftl files. Here's my template:
<#import "/org/springframework/web/servlet/view/freemarker/spring.ftl"
as spring />
<@spring.bind "user.*"/>=20
<#if spring.status.error>
<div class=3D"error">
<#list spring.status.errorMessages as error>
${error}<br/>
</#list>
</div>
</#if>
Here's the bug from including *.ftl:
http://opensource.atlassian.com/projects/spring/browse/SPR-225
HTH,
Matt
> -----Original Message-----
> From: spr...@li...=20
> [mailto:spr...@li...]
> On Behalf Of J=E9r=F4me BERNARD
> Sent: Tuesday, July 20, 2004 4:17 PM
> To: spr...@li...
> Subject: [Springframework-developer] Problem with=20
> FreeMarkerFormView...
>=20
>=20
> I tried the following template:
> <#import "/spring.ftl" as spring />
> <html>
> <body>
> <@spring.bind path=3D"command.*">
> <#list status.errorMessages as error>
> Error code: ${error}<br/>
> </#list>
> </@spring.bind>
> </body>
>=20
> When the macro @spring.bind is called, I do have the=20
> following error: Error on line 62, column 9 in spring.ftl=20
> springBindStatusHelper.createBindStatus(path, escape) is=20
> undefined. It cannot be assigned to status The problematic=20
> instruction:
> ----------
> =3D=3D> assignment: =
status=3DspringBindStatusHelper.createBindStatus(path,=20
> escape) [on line 62, column 9 in spring.ftl]
> in user-directive spring.bind [on line 12, column 1 in user.ftl]
> ----------
>=20
> Java backtrace for programmers:
> ----------
> freemarker.core.InvalidReferenceException: Error on line 62,=20
> column 9 in=20
> spring.ftl
> springBindStatusHelper.createBindStatus(path, escape) is=20
> undefined. It cannot be assigned to status
> at freemarker.core.Assignment.accept(Assignment.java:112)
> at freemarker.core.Environment.visit(Environment.java:171)
> at freemarker.core.Macro$Context.runMacro(Macro.java:164)
> at freemarker.core.Environment.visit(Environment.java:470)
> [...]
>=20
>=20
> Have someone been able to use FreeMarkerFormView properly?
> Do I need to add something "special" in my configurer for FreeMarker?
>=20
> TIA,
> J=E9r=F4me.
>=20
>=20
> -------------------------------------------------------
> This SF.Net email is sponsored by BEA Weblogic Workshop
> FREE Java Enterprise J2EE developer tools!
> Get your free copy of BEA WebLogic Workshop 8.1 today.=20
http://ads.osdn.com/?ad_idG21&alloc_id=10040&op=CCk
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|
|
From: Darren D. <da...@da...> - 2004-07-21 06:02:28
|
On Wednesday 21 July 2004 00:45, Matt Raible wrote: > Here's the bug from including *.ftl: > > http://opensource.atlassian.com/projects/spring/browse/SPR-225 thanks for that Matt, I've committed the fix. -- Darren Davison Public Key: http://www.davison.uk.net/pages/key.htm |
|
From: B. <jer...@xt...> - 2004-07-21 08:58:22
|
Selon Matt Raible <li...@ra...>:
> I've got it to work, but only after modifying the build.xml in CVS to
> include *.ftl files. Here's my template:
>
> <#import "/org/springframework/web/servlet/view/freemarker/spring.ftl"
> as spring />
I did copy it from CVS into my template path so this was not the issue I =
had
trouble with :-)
> <@spring.bind "user.*"/>
> <#if spring.status.error>
> <div class=3D"error">
> <#list spring.status.errorMessages as error>
> ${error}<br/>
> </#list>
> </div>
> </#if>
I finally found the problem thanks to your post. The thing is I find the
documentation (section 12.5.3.1) quite confusing: it binds with paths suc=
h as
"command.name", "command.age", "command.address.street", etc. and I thoug=
ht
that instead of using the name of my command, that I had to use the "comm=
and"
keyword. The doco should be clarified somehow by indicating that the bind=
path
is from the model map and that the "command" string is not a keyword.
Sorry for being too dumb :-)
Anyway, I've got this work working now!
Thanks,
J=E9r=F4me.
|
|
From: Darren D. <da...@da...> - 2004-07-21 09:20:27
|
> I finally found the problem thanks to your post. The thing is I find th= e > documentation (section 12.5.3.1) quite confusing: it binds with paths s= uch > as > "command.name", "command.age", "command.address.street", etc. and I > thought > that instead of using the name of my command, that I had to use the > "command" > keyword. The doco should be clarified somehow by indicating that the bi= nd > path > is from the model map and that the "command" string is not a keyword. I'll ensure this is clarified in the relevant section of the docs. Cheers. --=20 Darren Davison Public Key: http://www.davison.uk.net/pages/key.htm |