You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Vinay (JIRA)" <de...@velocity.apache.org> on 2009/11/09 19:57:32 UTC
[jira] Created: (VELOCITY-743) The character ":" if present within
the curly braces of a variable throws exception
The character ":" if present within the curly braces of a variable throws exception
------------------------------------------------------------------------------------
Key: VELOCITY-743
URL: https://issues.apache.org/jira/browse/VELOCITY-743
Project: Velocity
Issue Type: Bug
Affects Versions: 1.6.2
Environment: JRE 6, Apache tomcat 6.0.18
Reporter: Vinay
I am trying to write a template that is customized like this
-----------------------------------------------------------------------------
<hi>
<variable1> ${EPL_JOBTITLE:varB_EPL} </variable1>
<variable2>${SPL_EMPLOYEENUMBER:varA_SPL} </variable2>
</hi>
-----------------------------------------------------------------------------
Now the ${EPL_JOBTITLE:varB_EPL} is custom parsed and replaced with the appropriate values in the context.
However, as soon as the Template is loaded by the velocity engine I get a
Template Parse Exception :
Encountered ":varB_EPL}\r\n\r\n\r\n" at MY Script - 1\Test this.vm[line 1, column 15]
Was expecting one of:
"}" ...
<DOT> ...
How is the ":" character an invalid one within braces ? Shouldn't it be supported within a variable name?
--
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-743) The character ":" if present
within the curly braces of a variable throws exception
Posted by "Jarkko Viinamäki (JIRA)" <de...@velocity.apache.org>.
[ https://issues.apache.org/jira/browse/VELOCITY-743?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12929588#action_12929588 ]
Jarkko Viinamäki commented on VELOCITY-743:
-------------------------------------------
I think the regexp for allowed reference names should be the same in both formats (with and without curly braces). Otherwise it's inconsistent. So -1 for this RFE idea.
> The character ":" if present within the curly braces of a variable throws exception
> ------------------------------------------------------------------------------------
>
> Key: VELOCITY-743
> URL: https://issues.apache.org/jira/browse/VELOCITY-743
> Project: Velocity
> Issue Type: Improvement
> Components: Engine
> Affects Versions: 1.6.2
> Environment: JRE 6, Apache tomcat 6.0.18
> Reporter: Vinay
> Priority: Minor
>
> I am trying to write a template that is customized like this
> -----------------------------------------------------------------------------
> <hi>
> <variable1> ${EPL_JOBTITLE:varB_EPL} </variable1>
> <variable2>${SPL_EMPLOYEENUMBER:varA_SPL} </variable2>
> </hi>
> -----------------------------------------------------------------------------
> Now the ${EPL_JOBTITLE:varB_EPL} is custom parsed and replaced with the appropriate values in the context.
> However, as soon as the Template is loaded by the velocity engine I get a
> Template Parse Exception :
> Encountered ":varB_EPL}\r\n\r\n\r\n" at MY Script - 1\Test this.vm[line 1, column 15]
> Was expecting one of:
> "}" ...
> <DOT> ...
> How is the ":" character an invalid one within braces ? Shouldn't it be supported within a variable name?
--
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-743) The character ":" if present within
the curly braces of a variable throws exception
Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
[ https://issues.apache.org/jira/browse/VELOCITY-743?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nathan Bubna updated VELOCITY-743:
----------------------------------
Component/s: Engine
Priority: Minor (was: Major)
Issue Type: Improvement (was: Bug)
Sorry, this is intentional. The colon is not a supported character in references. It will certainly never be considered a valid reference character for standard $reference notation.
I'll leave this open as an RFE though, since i suppose it would be possible to increase the scope of legal reference characters in formal ${reference} notation.
For now, your best bet is probably to add the context to itself:
context.put("ctx", context);
and then do $ctx.get("EPL_JOBTITLE:varB_EPL") to give yourself more character freedom.
> The character ":" if present within the curly braces of a variable throws exception
> ------------------------------------------------------------------------------------
>
> Key: VELOCITY-743
> URL: https://issues.apache.org/jira/browse/VELOCITY-743
> Project: Velocity
> Issue Type: Improvement
> Components: Engine
> Affects Versions: 1.6.2
> Environment: JRE 6, Apache tomcat 6.0.18
> Reporter: Vinay
> Priority: Minor
>
> I am trying to write a template that is customized like this
> -----------------------------------------------------------------------------
> <hi>
> <variable1> ${EPL_JOBTITLE:varB_EPL} </variable1>
> <variable2>${SPL_EMPLOYEENUMBER:varA_SPL} </variable2>
> </hi>
> -----------------------------------------------------------------------------
> Now the ${EPL_JOBTITLE:varB_EPL} is custom parsed and replaced with the appropriate values in the context.
> However, as soon as the Template is loaded by the velocity engine I get a
> Template Parse Exception :
> Encountered ":varB_EPL}\r\n\r\n\r\n" at MY Script - 1\Test this.vm[line 1, column 15]
> Was expecting one of:
> "}" ...
> <DOT> ...
> How is the ":" character an invalid one within braces ? Shouldn't it be supported within a variable name?
--
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