1.2-SNAPSHOT: <%= %> in meta tags in gsp files rendered to garbage.

View: New views
5 Messages — Rating Filter:   Alert me  

1.2-SNAPSHOT: <%= %> in meta tags in gsp files rendered to garbage.

by Rainer Brang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, is there a reason for grails/spring/whoever to rearrange _the  
parameter order_ of meta tags in .gsp views? And why does it fail to  
do so correctly ?

In my .gsp I have (simplified example):
<meta name="description" content="<%='anything here' %> and here" />

The resulting html code in the browser looks like this:
<meta content="<%="anything here" name="description"/> and here" />

which results in
and here" />
somewhere visible on the page.


Is this an example of an unneccessary feature going haywire ? Why  
beautifying meta tags anyways ?
Does it happen to other tags, too? Should I JIRA this?

It's happening in an 1.2 snapshot I fetched via git today.


Best regards,
Rainer

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

    http://xircles.codehaus.org/manage_email



Re: 1.2-SNAPSHOT: <%= %> in meta tags in gsp files rendered to garbage.

by Graeme Rocher-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This is down to GSP preprocessing for Sitemesh which improves
performance. The fix is to either use ${..} instead of <%= %> or if
you must use this feature you'll have to disable the preprocessing
(and take the performance hit) by setting the following in
Config.groovy:

grails.views.gsp.sitemesh.preprocess=false

Please send feature questions like this to the user list

Cheers

On Mon, Nov 2, 2009 at 10:24 PM, Rainer Brang <info@...> wrote:

> Hi, is there a reason for grails/spring/whoever to rearrange _the parameter
> order_ of meta tags in .gsp views? And why does it fail to do so correctly ?
>
> In my .gsp I have (simplified example):
> <meta name="description" content="<%='anything here' %> and here" />
>
> The resulting html code in the browser looks like this:
> <meta content="<%="anything here" name="description"/> and here" />
>
> which results in
> and here" />
> somewhere visible on the page.
>
>
> Is this an example of an unneccessary feature going haywire ? Why
> beautifying meta tags anyways ?
> Does it happen to other tags, too? Should I JIRA this?
>
> It's happening in an 1.2 snapshot I fetched via git today.
>
>
> Best regards,
> Rainer
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>   http://xircles.codehaus.org/manage_email
>
>
>



--
Graeme Rocher
Head of Grails Development
SpringSource - Weapons for the War on Java Complexity
http://www.springsource.com

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

    http://xircles.codehaus.org/manage_email



Re: 1.2-SNAPSHOT: <%= %> in meta tags in gsp files rendered to garbage.

by Rainer Brang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Graeme,
sorry for posting to the wrong list, I wasn't aware this is a feature  
question. I guessed it to be a bug, because it behaves SO strangely.
But I'd not like to split this discussion up right here. Next time  
I'll post to the user group. Promised.

I guess one could live with: "Don't use <%=... %>" but "Use ${} and  
don't use double quotes" really sounds like there's a bug in escaping  
quotes (and <%=...%> tags) somewhere.

Please see this:
<meta name="description" content="${new String('Yeah')} line 1" />
<meta name="description" content="${new String("Yeah")} line 2" />
<meta name="description" content="<%=new String('Yeah')%> line 3" />
<meta name="description" content="<%=new String("Yeah")%> line 4" />

<p><%=new String('Yeah')%> line 6</p>
<p><%=new String("Yeah")%> line 7</p>
<p>${new String('Yeah')} line 8</p>
<p>${new String("Yeah")} line 9</p>



Renders to:
<meta content="Yeah line 1" name="description"/>
<meta name="description"/>
<meta name="description"/> line 3" />
<meta name="description"/> line 4" />

<p>Yeah line 6</p>
<p>Yeah line 7</p>
<p>Yeah line 8</p>
<p>Yeah line 9</p>


Please tell me it's a bug, because I don't want to live with  
performance penalties I have to switch on myself ;-)

Best regards,
Rainer




Am 03.11.2009 um 08:50 schrieb Graeme Rocher:

> This is down to GSP preprocessing for Sitemesh which improves
> performance. The fix is to either use ${..} instead of <%= %> or if
> you must use this feature you'll have to disable the preprocessing
> (and take the performance hit) by setting the following in
> Config.groovy:
>
> grails.views.gsp.sitemesh.preprocess=false
>
> Please send feature questions like this to the user list
>
> Cheers
>
> On Mon, Nov 2, 2009 at 10:24 PM, Rainer Brang <info@backend-
> server.de> wrote:
>> Hi, is there a reason for grails/spring/whoever to rearrange _the  
>> parameter
>> order_ of meta tags in .gsp views? And why does it fail to do so  
>> correctly ?
>>
>> In my .gsp I have (simplified example):
>> <meta name="description" content="<%='anything here' %> and here" />
>>
>> The resulting html code in the browser looks like this:
>> <meta content="<%="anything here" name="description"/> and here" />
>>
>> which results in
>> and here" />
>> somewhere visible on the page.
>>
>>
>> Is this an example of an unneccessary feature going haywire ? Why
>> beautifying meta tags anyways ?
>> Does it happen to other tags, too? Should I JIRA this?
>>
>> It's happening in an 1.2 snapshot I fetched via git today.
>>
>>
>> Best regards,
>> Rainer
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>   http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>
>
> --
> Graeme Rocher
> Head of Grails Development
> SpringSource - Weapons for the War on Java Complexity
> http://www.springsource.com
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


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

    http://xircles.codehaus.org/manage_email



Re: 1.2-SNAPSHOT: <%= %> in meta tags in gsp files rendered to garbage.

by Graeme Rocher-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It looks like a bug yes

On Tue, Nov 3, 2009 at 1:23 PM, Rainer Brang <info@...> wrote:

> Hi Graeme,
> sorry for posting to the wrong list, I wasn't aware this is a feature
> question. I guessed it to be a bug, because it behaves SO strangely.
> But I'd not like to split this discussion up right here. Next time I'll post
> to the user group. Promised.
>
> I guess one could live with: "Don't use <%=... %>" but "Use ${} and don't
> use double quotes" really sounds like there's a bug in escaping quotes (and
> <%=...%> tags) somewhere.
>
> Please see this:
> <meta name="description" content="${new String('Yeah')} line 1" />
> <meta name="description" content="${new String("Yeah")} line 2" />
> <meta name="description" content="<%=new String('Yeah')%> line 3" />
> <meta name="description" content="<%=new String("Yeah")%> line 4" />
>
> <p><%=new String('Yeah')%> line 6</p>
> <p><%=new String("Yeah")%> line 7</p>
> <p>${new String('Yeah')} line 8</p>
> <p>${new String("Yeah")} line 9</p>
>
>
>
> Renders to:
> <meta content="Yeah line 1" name="description"/>
> <meta name="description"/>
> <meta name="description"/> line 3" />
> <meta name="description"/> line 4" />
>
> <p>Yeah line 6</p>
> <p>Yeah line 7</p>
> <p>Yeah line 8</p>
> <p>Yeah line 9</p>
>
>
> Please tell me it's a bug, because I don't want to live with performance
> penalties I have to switch on myself ;-)
>
> Best regards,
> Rainer
>
>
>
>
> Am 03.11.2009 um 08:50 schrieb Graeme Rocher:
>
>> This is down to GSP preprocessing for Sitemesh which improves
>> performance. The fix is to either use ${..} instead of <%= %> or if
>> you must use this feature you'll have to disable the preprocessing
>> (and take the performance hit) by setting the following in
>> Config.groovy:
>>
>> grails.views.gsp.sitemesh.preprocess=false
>>
>> Please send feature questions like this to the user list
>>
>> Cheers
>>
>> On Mon, Nov 2, 2009 at 10:24 PM, Rainer Brang <info@...>
>> wrote:
>>>
>>> Hi, is there a reason for grails/spring/whoever to rearrange _the
>>> parameter
>>> order_ of meta tags in .gsp views? And why does it fail to do so
>>> correctly ?
>>>
>>> In my .gsp I have (simplified example):
>>> <meta name="description" content="<%='anything here' %> and here" />
>>>
>>> The resulting html code in the browser looks like this:
>>> <meta content="<%="anything here" name="description"/> and here" />
>>>
>>> which results in
>>> and here" />
>>> somewhere visible on the page.
>>>
>>>
>>> Is this an example of an unneccessary feature going haywire ? Why
>>> beautifying meta tags anyways ?
>>> Does it happen to other tags, too? Should I JIRA this?
>>>
>>> It's happening in an 1.2 snapshot I fetched via git today.
>>>
>>>
>>> Best regards,
>>> Rainer
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list, please visit:
>>>
>>>  http://xircles.codehaus.org/manage_email
>>>
>>>
>>>
>>
>>
>>
>> --
>> Graeme Rocher
>> Head of Grails Development
>> SpringSource - Weapons for the War on Java Complexity
>> http://www.springsource.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>   http://xircles.codehaus.org/manage_email
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>   http://xircles.codehaus.org/manage_email
>
>
>



--
Graeme Rocher
Head of Grails Development
SpringSource - Weapons for the War on Java Complexity
http://www.springsource.com

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

    http://xircles.codehaus.org/manage_email



Re: 1.2-SNAPSHOT: <%= %> in meta tags in gsp files rendered to garbage.

by Rainer Brang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Graeme, thanks for your time and your patience...

I just filed it: http://jira.codehaus.org/browse/GRAILS-5299


Best regards,
Rainer


Am 03.11.2009 um 13:44 schrieb Graeme Rocher:

> It looks like a bug yes
>
> On Tue, Nov 3, 2009 at 1:23 PM, Rainer Brang <info@backend-
> server.de> wrote:
>> Hi Graeme,
>> sorry for posting to the wrong list, I wasn't aware this is a feature
>> question. I guessed it to be a bug, because it behaves SO strangely.
>> But I'd not like to split this discussion up right here. Next time  
>> I'll post
>> to the user group. Promised.
>>
>> I guess one could live with: "Don't use <%=... %>" but "Use ${} and  
>> don't
>> use double quotes" really sounds like there's a bug in escaping  
>> quotes (and
>> <%=...%> tags) somewhere.
>>
>> Please see this:
>> <meta name="description" content="${new String('Yeah')} line 1" />
>> <meta name="description" content="${new String("Yeah")} line 2" />
>> <meta name="description" content="<%=new String('Yeah')%> line 3" />
>> <meta name="description" content="<%=new String("Yeah")%> line 4" />
>>
>> <p><%=new String('Yeah')%> line 6</p>
>> <p><%=new String("Yeah")%> line 7</p>
>> <p>${new String('Yeah')} line 8</p>
>> <p>${new String("Yeah")} line 9</p>
>>
>>
>>
>> Renders to:
>> <meta content="Yeah line 1" name="description"/>
>> <meta name="description"/>
>> <meta name="description"/> line 3" />
>> <meta name="description"/> line 4" />
>>
>> <p>Yeah line 6</p>
>> <p>Yeah line 7</p>
>> <p>Yeah line 8</p>
>> <p>Yeah line 9</p>
>>
>>
>> Please tell me it's a bug, because I don't want to live with  
>> performance
>> penalties I have to switch on myself ;-)
>>
>> Best regards,
>> Rainer
>>
>>
>>
>>
>> Am 03.11.2009 um 08:50 schrieb Graeme Rocher:
>>
>>> This is down to GSP preprocessing for Sitemesh which improves
>>> performance. The fix is to either use ${..} instead of <%= %> or if
>>> you must use this feature you'll have to disable the preprocessing
>>> (and take the performance hit) by setting the following in
>>> Config.groovy:
>>>
>>> grails.views.gsp.sitemesh.preprocess=false
>>>
>>> Please send feature questions like this to the user list
>>>
>>> Cheers
>>>
>>> On Mon, Nov 2, 2009 at 10:24 PM, Rainer Brang <info@...
>>> >
>>> wrote:
>>>>
>>>> Hi, is there a reason for grails/spring/whoever to rearrange _the
>>>> parameter
>>>> order_ of meta tags in .gsp views? And why does it fail to do so
>>>> correctly ?
>>>>
>>>> In my .gsp I have (simplified example):
>>>> <meta name="description" content="<%='anything here' %> and  
>>>> here" />
>>>>
>>>> The resulting html code in the browser looks like this:
>>>> <meta content="<%="anything here" name="description"/> and here" />
>>>>
>>>> which results in
>>>> and here" />
>>>> somewhere visible on the page.
>>>>
>>>>
>>>> Is this an example of an unneccessary feature going haywire ? Why
>>>> beautifying meta tags anyways ?
>>>> Does it happen to other tags, too? Should I JIRA this?
>>>>
>>>> It's happening in an 1.2 snapshot I fetched via git today.
>>>>
>>>>
>>>> Best regards,
>>>> Rainer
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe from this list, please visit:
>>>>
>>>>  http://xircles.codehaus.org/manage_email
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Graeme Rocher
>>> Head of Grails Development
>>> SpringSource - Weapons for the War on Java Complexity
>>> http://www.springsource.com
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list, please visit:
>>>
>>>   http://xircles.codehaus.org/manage_email
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>   http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>
>
> --
> Graeme Rocher
> Head of Grails Development
> SpringSource - Weapons for the War on Java Complexity
> http://www.springsource.com
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


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

    http://xircles.codehaus.org/manage_email