You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Lars Trieloff (JIRA)" <ji...@apache.org> on 2008/02/17 22:46:34 UTC

[jira] Commented: (SLING-248) esps not executed quite correctly

    [ https://issues.apache.org/jira/browse/SLING-248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12569755#action_12569755 ] 

Lars Trieloff commented on SLING-248:
-------------------------------------

I think we should re-open, as the compact syntax should extend the default syntax, not replace it.

> esps not executed quite correctly
> ---------------------------------
>
>                 Key: SLING-248
>                 URL: https://issues.apache.org/jira/browse/SLING-248
>             Project: Sling
>          Issue Type: Bug
>          Components: Scripting
>         Environment: windows xp, java 5
>            Reporter: Michael Marth
>            Assignee: Felix Meschberger
>             Fix For: 2.0.0
>
>
> I have an .esp with this code snippet:
> posted by <a href="/microsling/content/blogs/main.html?poster=<%=resource.node.posterName%>"> <%=resource.node.posterName%></a>
> the first <%=resource.node.posterName%> does not get executed, the second does.
> I experimented a bit and think that <%= %> scripts embedded in an html attribute do not get executed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (SLING-248) esps not executed quite correctly

Posted by Lars Trieloff <la...@trieloff.net>.
Hi Felix,

I am aware of this. I just wanted to show that you sometimes cannot  
make use of the compact syntax in attributes, so you have to fall back  
to the angle-bracket-syntax.

regards,

Lars

On 18.02.2008, at 13:22, Felix Meschberger wrote:

> Hi,
>
> Am Montag, den 18.02.2008, 11:48 +0100 schrieb Lars Trieloff:
>> The compact syntax was introduced for increased readability and
>> compatibility with JSP expressions. Additionally, using the compact
>> syntax keeps your HTML valid, which helps IDEs to highlight ESP.
>
> ok. thanks.
>
>>
>> There are however cases, where the default syntax is the more compact
>> way to express something, e.g. if you want to have extended control
>> structures in the scriptlet.
>>
>> <%
>> var value;
>> if (foo==bar) {
>> 	value = "foo";
>> } else {
>> 	value = "bar";
>> }
>> %>
>>
>> <a href="http://${value}.com/">
>>
>> vs.
>>
>> <a href="http://<% if (foo==bar) {%>foo<%} else {%>foo<%} %>">
>
> don't confuse <%=...%> and <%...%>. These are not the same things and
> (in ESP) ${...} is just a different notation for <%=...%>. So in the
> above example, the comparison is
>
>   <a href="http://<%= value =>.com/">
>
> vs.
>
>    <a href="http://${value}.com/">
>
> Regards
> Felix
>
>>
>>
>> regards,
>>
>> Lars
>>
>> On Mon, 2008-02-18 at 08:52 +0100, Felix Meschberger wrote:
>>> Hi all,
>>>
>>> Hmm, I am getting unsure ... Why was the compact syntax "${...}"
>>> introduced at all ? Was it to mimic Expression Language stuff ? Not
>>> sure, whether we really need this in ESP.
>>>
>>> If someone could enlighten me ?
>>>
>>> Regards
>>> Felix
>>>
>>>
>>> Am Sonntag, den 17.02.2008, 13:46 -0800 schrieb Lars Trieloff  
>>> (JIRA):
>>>> [ https://issues.apache.org/jira/browse/SLING-248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12569755 
>>>> #action_12569755 ]
>>>>
>>>> Lars Trieloff commented on SLING-248:
>>>> -------------------------------------
>>>>
>>>> I think we should re-open, as the compact syntax should extend  
>>>> the default syntax, not replace it.
>>>>
>>>>> esps not executed quite correctly
>>>>> ---------------------------------
>>>>>
>>>>>                Key: SLING-248
>>>>>                URL: https://issues.apache.org/jira/browse/ 
>>>>> SLING-248
>>>>>            Project: Sling
>>>>>         Issue Type: Bug
>>>>>         Components: Scripting
>>>>>        Environment: windows xp, java 5
>>>>>           Reporter: Michael Marth
>>>>>           Assignee: Felix Meschberger
>>>>>            Fix For: 2.0.0
>>>>>
>>>>>
>>>>> I have an .esp with this code snippet:
>>>>> posted by <a href="/microsling/content/blogs/main.html?poster=< 
>>>>> %=resource.node.posterName%>"> <%=resource.node.posterName%></a>
>>>>> the first <%=resource.node.posterName%> does not get executed,  
>>>>> the second does.
>>>>> I experimented a bit and think that <%= %> scripts embedded in  
>>>>> an html attribute do not get executed.
>>>>
>>>
>>
>

--
Lars Trieloff
lars@trieloff.net
http://weblogs.goshaky.com/weblogs/lars


Re: [jira] Commented: (SLING-248) esps not executed quite correctly

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

Am Montag, den 18.02.2008, 11:48 +0100 schrieb Lars Trieloff:
> The compact syntax was introduced for increased readability and
> compatibility with JSP expressions. Additionally, using the compact
> syntax keeps your HTML valid, which helps IDEs to highlight ESP.

ok. thanks.

> 
> There are however cases, where the default syntax is the more compact
> way to express something, e.g. if you want to have extended control
> structures in the scriptlet.
> 
> <% 
> var value;
> if (foo==bar) {
> 	value = "foo";
> } else {
> 	value = "bar";
> }
> %>
> 
> <a href="http://${value}.com/">
> 
> vs.
> 
> <a href="http://<% if (foo==bar) {%>foo<%} else {%>foo<%} %>">

don't confuse <%=...%> and <%...%>. These are not the same things and
(in ESP) ${...} is just a different notation for <%=...%>. So in the
above example, the comparison is 

   <a href="http://<%= value =>.com/">

vs.

    <a href="http://${value}.com/">

Regards
Felix

> 
> 
> regards,
> 
> Lars
> 
> On Mon, 2008-02-18 at 08:52 +0100, Felix Meschberger wrote:
> > Hi all,
> > 
> > Hmm, I am getting unsure ... Why was the compact syntax "${...}"
> > introduced at all ? Was it to mimic Expression Language stuff ? Not
> > sure, whether we really need this in ESP.
> > 
> > If someone could enlighten me ?
> > 
> > Regards
> > Felix
> > 
> > 
> > Am Sonntag, den 17.02.2008, 13:46 -0800 schrieb Lars Trieloff (JIRA):
> > > [ https://issues.apache.org/jira/browse/SLING-248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12569755#action_12569755 ] 
> > > 
> > > Lars Trieloff commented on SLING-248:
> > > -------------------------------------
> > > 
> > > I think we should re-open, as the compact syntax should extend the default syntax, not replace it.
> > > 
> > > > esps not executed quite correctly
> > > > ---------------------------------
> > > >
> > > >                 Key: SLING-248
> > > >                 URL: https://issues.apache.org/jira/browse/SLING-248
> > > >             Project: Sling
> > > >          Issue Type: Bug
> > > >          Components: Scripting
> > > >         Environment: windows xp, java 5
> > > >            Reporter: Michael Marth
> > > >            Assignee: Felix Meschberger
> > > >             Fix For: 2.0.0
> > > >
> > > >
> > > > I have an .esp with this code snippet:
> > > > posted by <a href="/microsling/content/blogs/main.html?poster=<%=resource.node.posterName%>"> <%=resource.node.posterName%></a>
> > > > the first <%=resource.node.posterName%> does not get executed, the second does.
> > > > I experimented a bit and think that <%= %> scripts embedded in an html attribute do not get executed.
> > > 
> > 
> 


Re: [jira] Commented: (SLING-248) esps not executed quite correctly

Posted by Lars Trieloff <la...@trieloff.net>.
The compact syntax was introduced for increased readability and
compatibility with JSP expressions. Additionally, using the compact
syntax keeps your HTML valid, which helps IDEs to highlight ESP.

There are however cases, where the default syntax is the more compact
way to express something, e.g. if you want to have extended control
structures in the scriptlet.

<% 
var value;
if (foo==bar) {
	value = "foo";
} else {
	value = "bar";
}
%>

<a href="http://${value}.com/">

vs.

<a href="http://<% if (foo==bar) {%>foo<%} else {%>foo<%} %>">


regards,

Lars

On Mon, 2008-02-18 at 08:52 +0100, Felix Meschberger wrote:
> Hi all,
> 
> Hmm, I am getting unsure ... Why was the compact syntax "${...}"
> introduced at all ? Was it to mimic Expression Language stuff ? Not
> sure, whether we really need this in ESP.
> 
> If someone could enlighten me ?
> 
> Regards
> Felix
> 
> 
> Am Sonntag, den 17.02.2008, 13:46 -0800 schrieb Lars Trieloff (JIRA):
> > [ https://issues.apache.org/jira/browse/SLING-248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12569755#action_12569755 ] 
> > 
> > Lars Trieloff commented on SLING-248:
> > -------------------------------------
> > 
> > I think we should re-open, as the compact syntax should extend the default syntax, not replace it.
> > 
> > > esps not executed quite correctly
> > > ---------------------------------
> > >
> > >                 Key: SLING-248
> > >                 URL: https://issues.apache.org/jira/browse/SLING-248
> > >             Project: Sling
> > >          Issue Type: Bug
> > >          Components: Scripting
> > >         Environment: windows xp, java 5
> > >            Reporter: Michael Marth
> > >            Assignee: Felix Meschberger
> > >             Fix For: 2.0.0
> > >
> > >
> > > I have an .esp with this code snippet:
> > > posted by <a href="/microsling/content/blogs/main.html?poster=<%=resource.node.posterName%>"> <%=resource.node.posterName%></a>
> > > the first <%=resource.node.posterName%> does not get executed, the second does.
> > > I experimented a bit and think that <%= %> scripts embedded in an html attribute do not get executed.
> > 
> 


Re: [jira] Commented: (SLING-248) esps not executed quite correctly

Posted by Felix Meschberger <fm...@gmail.com>.
Hi all,

Hmm, I am getting unsure ... Why was the compact syntax "${...}"
introduced at all ? Was it to mimic Expression Language stuff ? Not
sure, whether we really need this in ESP.

If someone could enlighten me ?

Regards
Felix


Am Sonntag, den 17.02.2008, 13:46 -0800 schrieb Lars Trieloff (JIRA):
> [ https://issues.apache.org/jira/browse/SLING-248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12569755#action_12569755 ] 
> 
> Lars Trieloff commented on SLING-248:
> -------------------------------------
> 
> I think we should re-open, as the compact syntax should extend the default syntax, not replace it.
> 
> > esps not executed quite correctly
> > ---------------------------------
> >
> >                 Key: SLING-248
> >                 URL: https://issues.apache.org/jira/browse/SLING-248
> >             Project: Sling
> >          Issue Type: Bug
> >          Components: Scripting
> >         Environment: windows xp, java 5
> >            Reporter: Michael Marth
> >            Assignee: Felix Meschberger
> >             Fix For: 2.0.0
> >
> >
> > I have an .esp with this code snippet:
> > posted by <a href="/microsling/content/blogs/main.html?poster=<%=resource.node.posterName%>"> <%=resource.node.posterName%></a>
> > the first <%=resource.node.posterName%> does not get executed, the second does.
> > I experimented a bit and think that <%= %> scripts embedded in an html attribute do not get executed.
>