modify templates.

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

modify templates.

Mauro
In the view templates, used by scaffolding, I want to add 
<meta name="pageId" content="${controllerName}.${actionName}" />

but when I run generate-view I've this error:

Error Error running script generate-views supplierregister.Category : No such property: controllerName for class: SimpleTemplateScript1

I don't want to resolve ${controllerName}.${actionName} but simply put the tag as is.
Can it be done?
Reply | Threaded
Open this post in threaded view
|

Re: modify templates.

Ian Roberts
On 21/08/2013 12:05, Mauro Sanna wrote:

> In the view templates, used by scaffolding, I want to add
> <meta name="pageId" content="${controllerName}.${actionName}" />
>
> but when I run generate-view I've this error:
>
> Error Error running script generate-views supplierregister.Category : No
> such property: controllerName for class: SimpleTemplateScript1
>
> I don't want to resolve ${controllerName}.${actionName} but simply put
> the tag as is.
> Can it be done?

If you want to put a literal $ into the GSP that is generated by the
scaffolding template then you need to put a backslash in front of it

<meta name="pageId" content="\${controllerName}.\${actionName}" />

The rule is that unescaped dollar signs are interpreted by the
scaffolding generator, escaped dollar signs are interpreted at runtime
by the GSP engine.  You can see this in action in many places in the
existing templates, for example

<td valign="top" class="value">\${fieldValue(bean: ${propertyName},
field: "${p.name}")}</td>

Ian

--
Ian Roberts               | Department of Computer Science
[hidden email]  | University of Sheffield, UK

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: modify templates.

xunitc
In reply to this post by Mauro
Hi.
Perhaps the '$' need to escape, try it?

2013/8/21 Mauro Sanna <[hidden email]>:

> In the view templates, used by scaffolding, I want to add
> <meta name="pageId" content="${controllerName}.${actionName}" />
>
> but when I run generate-view I've this error:
>
> Error Error running script generate-views supplierregister.Category : No
> such property: controllerName for class: SimpleTemplateScript1
>
> I don't want to resolve ${controllerName}.${actionName} but simply put the
> tag as is.
> Can it be done?



--
Xunitc.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Xunitc
Reply | Threaded
Open this post in threaded view
|

Re: modify templates.

Mauro
On 21 August 2013 13:34, xunitc <[hidden email]> wrote:
Hi.
Perhaps the '$' need to escape, try it?


Thanks to all.