You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Byron Foster (JIRA)" <de...@velocity.apache.org> on 2008/10/10 04:14:44 UTC

[jira] Created: (VELOCITY-623) Modify escape behavior in strict mode

Modify escape behavior in strict mode
-------------------------------------

                 Key: VELOCITY-623
                 URL: https://issues.apache.org/jira/browse/VELOCITY-623
             Project: Velocity
          Issue Type: New Feature
          Components: Engine
    Affects Versions: 1.6
            Reporter: Byron Foster
         Attachments: StrictEscapeWithProperty.patch

provides another property 'runtime.references.strict.escape' that when true modifies the behavior of escaping a reference when in strict mode, see discussion VELOCITY-618.  The behavior is a as follows:

$abc = <exception>    -  If $abc is not defined
\$abc = $abc 
\\$abc = <exception>  - If $abc is  not defined
\\\$abc = \$abc

The backslash in front of a reference always prevents that reference from being evaluated, and the backslash is removed. This is true wether a reference is in the context or not.


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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Closed: (VELOCITY-623) Modify escape behavior in strict mode

Posted by "Byron Foster (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-623?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Byron Foster closed VELOCITY-623.
---------------------------------

    Resolution: Fixed

I wasn't sure what to do about documentation.  I added the standard blurb about the property in the developer docs.  I think it will only serve to confuse by adding mention of this in the user's docs along with the already lengthy and confusing escape behavior description.

> Modify escape behavior in strict mode
> -------------------------------------
>
>                 Key: VELOCITY-623
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-623
>             Project: Velocity
>          Issue Type: New Feature
>          Components: Engine
>    Affects Versions: 1.6
>            Reporter: Byron Foster
>             Fix For: 1.7
>
>         Attachments: StrictEscapeWithProperty.patch
>
>
> provides another property 'runtime.references.strict.escape' that when true modifies the behavior of escaping a reference when in strict mode, see discussion VELOCITY-618.  The behavior is a as follows:
> $abc = <exception>    -  If $abc is not defined
> \$abc = $abc 
> \\$abc = <exception>  - If $abc is  not defined
> \\\$abc = \$abc
> The backslash in front of a reference always prevents that reference from being evaluated, and the backslash is removed. This is true wether a reference is in the context or not.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-623) Modify escape behavior in strict mode

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELOCITY-623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12648675#action_12648675 ] 

Nathan Bubna commented on VELOCITY-623:
---------------------------------------

Considering that there seem to be more changes hung up on backward compatibility than not, it might be time to open a 2.x branch after we get 1.6 released, and limit 1.7 or 1.6.x to small stuff.

> Modify escape behavior in strict mode
> -------------------------------------
>
>                 Key: VELOCITY-623
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-623
>             Project: Velocity
>          Issue Type: New Feature
>          Components: Engine
>    Affects Versions: 1.6
>            Reporter: Byron Foster
>             Fix For: 1.7
>
>         Attachments: StrictEscapeWithProperty.patch
>
>
> provides another property 'runtime.references.strict.escape' that when true modifies the behavior of escaping a reference when in strict mode, see discussion VELOCITY-618.  The behavior is a as follows:
> $abc = <exception>    -  If $abc is not defined
> \$abc = $abc 
> \\$abc = <exception>  - If $abc is  not defined
> \\\$abc = \$abc
> The backslash in front of a reference always prevents that reference from being evaluated, and the backslash is removed. This is true wether a reference is in the context or not.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-623) Modify escape behavior in strict mode

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELOCITY-623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12665595#action_12665595 ] 

Nathan Bubna commented on VELOCITY-623:
---------------------------------------

Yeah, the proposed property name is fine.  And i'm fine with this so long as it's configurable and works consistently for macros, directives and references.  If you can do it now, that'd be great.

> Modify escape behavior in strict mode
> -------------------------------------
>
>                 Key: VELOCITY-623
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-623
>             Project: Velocity
>          Issue Type: New Feature
>          Components: Engine
>    Affects Versions: 1.6
>            Reporter: Byron Foster
>             Fix For: 1.7
>
>         Attachments: StrictEscapeWithProperty.patch
>
>
> provides another property 'runtime.references.strict.escape' that when true modifies the behavior of escaping a reference when in strict mode, see discussion VELOCITY-618.  The behavior is a as follows:
> $abc = <exception>    -  If $abc is not defined
> \$abc = $abc 
> \\$abc = <exception>  - If $abc is  not defined
> \\\$abc = \$abc
> The backslash in front of a reference always prevents that reference from being evaluated, and the backslash is removed. This is true wether a reference is in the context or not.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-623) Modify escape behavior in strict mode

Posted by "Byron Foster (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELOCITY-623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12648667#action_12648667 ] 

Byron Foster commented on VELOCITY-623:
---------------------------------------

The parser needs to be changed for this, and most of the work involved I believe would be to maintain backward compatibility.  I would rather make the change when backward compatibility is not an issue.

> Modify escape behavior in strict mode
> -------------------------------------
>
>                 Key: VELOCITY-623
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-623
>             Project: Velocity
>          Issue Type: New Feature
>          Components: Engine
>    Affects Versions: 1.6
>            Reporter: Byron Foster
>             Fix For: 1.7
>
>         Attachments: StrictEscapeWithProperty.patch
>
>
> provides another property 'runtime.references.strict.escape' that when true modifies the behavior of escaping a reference when in strict mode, see discussion VELOCITY-618.  The behavior is a as follows:
> $abc = <exception>    -  If $abc is not defined
> \$abc = $abc 
> \\$abc = <exception>  - If $abc is  not defined
> \\\$abc = \$abc
> The backslash in front of a reference always prevents that reference from being evaluated, and the backslash is removed. This is true wether a reference is in the context or not.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-623) Modify escape behavior in strict mode

Posted by "Byron Foster (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELOCITY-623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12638631#action_12638631 ] 

Byron Foster commented on VELOCITY-623:
---------------------------------------

My thoughts are that no, there is no particular reason.  Macro's are a problem because the parser handles the escaping such that no node is even created for something like "\#abc() which makes it impossible to do the post parse processing that can be done with references.  If it wasn't for this I would have also "fixed" the macro escaping for strict mode :)  To change the behavior of macro escaping the parser will have to be changed, However, not a major change... 

In allot of ways strict mode along with sane escaping rules really simplifies things because then you either have a valid reference with no escape processing necessary, or a text node (maybe actually, or essentially).  As it stands the ASTReference Node has allot of member fields dedicated to various escape gymnastics.  I'm not even sure what all the bang escaping is for.

I think were you are going with this is that it would be nice to have a property that modifies the behavior of escaping, and perhaps tests how it will work in the future, in a python future sort of way.  If this is the case it would be good to get it all right.  Anyway, I'll look into it some more.






> Modify escape behavior in strict mode
> -------------------------------------
>
>                 Key: VELOCITY-623
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-623
>             Project: Velocity
>          Issue Type: New Feature
>          Components: Engine
>    Affects Versions: 1.6
>            Reporter: Byron Foster
>         Attachments: StrictEscapeWithProperty.patch
>
>
> provides another property 'runtime.references.strict.escape' that when true modifies the behavior of escaping a reference when in strict mode, see discussion VELOCITY-618.  The behavior is a as follows:
> $abc = <exception>    -  If $abc is not defined
> \$abc = $abc 
> \\$abc = <exception>  - If $abc is  not defined
> \\\$abc = \$abc
> The backslash in front of a reference always prevents that reference from being evaluated, and the backslash is removed. This is true wether a reference is in the context or not.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-623) Modify escape behavior in strict mode

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELOCITY-623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12638467#action_12638467 ] 

Nathan Bubna commented on VELOCITY-623:
---------------------------------------

Is there any particular reason the escaping has to be related to strict mode?  This is an improvement, as it shows the user intended to change escaping behavior.  But, could this change in escaping behavior work even without strict mode on?  Also, what about escaping directives and macros?

> Modify escape behavior in strict mode
> -------------------------------------
>
>                 Key: VELOCITY-623
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-623
>             Project: Velocity
>          Issue Type: New Feature
>          Components: Engine
>    Affects Versions: 1.6
>            Reporter: Byron Foster
>         Attachments: StrictEscapeWithProperty.patch
>
>
> provides another property 'runtime.references.strict.escape' that when true modifies the behavior of escaping a reference when in strict mode, see discussion VELOCITY-618.  The behavior is a as follows:
> $abc = <exception>    -  If $abc is not defined
> \$abc = $abc 
> \\$abc = <exception>  - If $abc is  not defined
> \\\$abc = \$abc
> The backslash in front of a reference always prevents that reference from being evaluated, and the backslash is removed. This is true wether a reference is in the context or not.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Reopened: (VELOCITY-623) Modify escape behavior in strict mode

Posted by "Byron Foster (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-623?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Byron Foster reopened VELOCITY-623:
-----------------------------------


I reopened this because with more familiarity with macro parsing, I can make this work for macros also.

Do we want to stick with given property name?

> Modify escape behavior in strict mode
> -------------------------------------
>
>                 Key: VELOCITY-623
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-623
>             Project: Velocity
>          Issue Type: New Feature
>          Components: Engine
>    Affects Versions: 1.6
>            Reporter: Byron Foster
>             Fix For: 1.7
>
>         Attachments: StrictEscapeWithProperty.patch
>
>
> provides another property 'runtime.references.strict.escape' that when true modifies the behavior of escaping a reference when in strict mode, see discussion VELOCITY-618.  The behavior is a as follows:
> $abc = <exception>    -  If $abc is not defined
> \$abc = $abc 
> \\$abc = <exception>  - If $abc is  not defined
> \\\$abc = \$abc
> The backslash in front of a reference always prevents that reference from being evaluated, and the backslash is removed. This is true wether a reference is in the context or not.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Updated: (VELOCITY-623) Modify escape behavior in strict mode

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-623?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nathan Bubna updated VELOCITY-623:
----------------------------------

    Fix Version/s: 1.7

Targeting for 1.7.   I'm still thinking that i'd at least want this work the same for directives/macros as for references, before we commit it.

> Modify escape behavior in strict mode
> -------------------------------------
>
>                 Key: VELOCITY-623
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-623
>             Project: Velocity
>          Issue Type: New Feature
>          Components: Engine
>    Affects Versions: 1.6
>            Reporter: Byron Foster
>             Fix For: 1.7
>
>         Attachments: StrictEscapeWithProperty.patch
>
>
> provides another property 'runtime.references.strict.escape' that when true modifies the behavior of escaping a reference when in strict mode, see discussion VELOCITY-618.  The behavior is a as follows:
> $abc = <exception>    -  If $abc is not defined
> \$abc = $abc 
> \\$abc = <exception>  - If $abc is  not defined
> \\\$abc = \$abc
> The backslash in front of a reference always prevents that reference from being evaluated, and the backslash is removed. This is true wether a reference is in the context or not.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-623) Modify escape behavior in strict mode

Posted by "Byron Foster (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELOCITY-623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12660468#action_12660468 ] 

Byron Foster commented on VELOCITY-623:
---------------------------------------

I'm going to close this because it's related to the 2.0 issue of escape syntax, which is better discussed in an issue that deals with the problem in general.  And yea, this should work for both macros and references.

> Modify escape behavior in strict mode
> -------------------------------------
>
>                 Key: VELOCITY-623
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-623
>             Project: Velocity
>          Issue Type: New Feature
>          Components: Engine
>    Affects Versions: 1.6
>            Reporter: Byron Foster
>             Fix For: 1.7
>
>         Attachments: StrictEscapeWithProperty.patch
>
>
> provides another property 'runtime.references.strict.escape' that when true modifies the behavior of escaping a reference when in strict mode, see discussion VELOCITY-618.  The behavior is a as follows:
> $abc = <exception>    -  If $abc is not defined
> \$abc = $abc 
> \\$abc = <exception>  - If $abc is  not defined
> \\\$abc = \$abc
> The backslash in front of a reference always prevents that reference from being evaluated, and the backslash is removed. This is true wether a reference is in the context or not.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Closed: (VELOCITY-623) Modify escape behavior in strict mode

Posted by "Byron Foster (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-623?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Byron Foster closed VELOCITY-623.
---------------------------------

    Resolution: Won't Fix

> Modify escape behavior in strict mode
> -------------------------------------
>
>                 Key: VELOCITY-623
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-623
>             Project: Velocity
>          Issue Type: New Feature
>          Components: Engine
>    Affects Versions: 1.6
>            Reporter: Byron Foster
>             Fix For: 1.7
>
>         Attachments: StrictEscapeWithProperty.patch
>
>
> provides another property 'runtime.references.strict.escape' that when true modifies the behavior of escaping a reference when in strict mode, see discussion VELOCITY-618.  The behavior is a as follows:
> $abc = <exception>    -  If $abc is not defined
> \$abc = $abc 
> \\$abc = <exception>  - If $abc is  not defined
> \\\$abc = \$abc
> The backslash in front of a reference always prevents that reference from being evaluated, and the backslash is removed. This is true wether a reference is in the context or not.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Updated: (VELOCITY-623) Modify escape behavior in strict mode

Posted by "Byron Foster (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-623?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Byron Foster updated VELOCITY-623:
----------------------------------

    Attachment: StrictEscapeWithProperty.patch

> Modify escape behavior in strict mode
> -------------------------------------
>
>                 Key: VELOCITY-623
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-623
>             Project: Velocity
>          Issue Type: New Feature
>          Components: Engine
>    Affects Versions: 1.6
>            Reporter: Byron Foster
>         Attachments: StrictEscapeWithProperty.patch
>
>
> provides another property 'runtime.references.strict.escape' that when true modifies the behavior of escaping a reference when in strict mode, see discussion VELOCITY-618.  The behavior is a as follows:
> $abc = <exception>    -  If $abc is not defined
> \$abc = $abc 
> \\$abc = <exception>  - If $abc is  not defined
> \\\$abc = \$abc
> The backslash in front of a reference always prevents that reference from being evaluated, and the backslash is removed. This is true wether a reference is in the context or not.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org