[
https://issues.apache.org/jira/browse/VELOCITY-795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12986382#action_12986382
]
Becky Cartine commented on VELOCITY-795:
----------------------------------------
I have further discovered that the code works if I call the method with the
'reader' object instead of the String 'message'
Velocity.evaluate(Context context, Writer writer, String logTag,Reader reader)
instead of
Velocity.evaluate(Context context, Writer writer, String logTag,String inString)
Here is the full stacktrace.
SEVERE: Parser Exception: Test
org.apache.velocity.runtime.parser.ParseException: Encountered "<EOF>" at line
1, column 396.
Was expecting one of:
( omitting list of tags )
...
at
org.apache.velocity.runtime.parser.Parser.generateParseException(Parser.java:3679)
at
org.apache.velocity.runtime.parser.Parser.jj_consume_token(Parser.java:3558)
at
org.apache.velocity.runtime.parser.Parser.IfStatement(Parser.java:1740)
at org.apache.velocity.runtime.parser.Parser.Statement(Parser.java:352)
at org.apache.velocity.runtime.parser.Parser.process(Parser.java:317)
at org.apache.velocity.runtime.parser.Parser.parse(Parser.java:117)
at
org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java:1226)
at
org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java:1181)
at
org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1297)
at
org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1265)
at org.apache.velocity.app.Velocity.evaluate(Velocity.java:180)
at VelocityTest.main(VelocityTest.java:35)
> Multiple #if statements causes ParseErrorException: Encountered "<EOF>"
> ------------------------------------------------------------------------
>
> Key: VELOCITY-795
> URL: https://issues.apache.org/jira/browse/VELOCITY-795
> Project: Velocity
> Issue Type: Bug
> Environment: Mac OSX, Java 1.5, Velocity 1.4
> Reporter: Becky Cartine
>
> When I include an #if statement twice in a velocity template, I get a
> ParseErrorException.
> If I remove the first occurance of the #if statement below, there are no
> errors.
> <html>
> <body>
> some text here
> #if ($message)
> Message:
> #end
> some more text
> #if ($message)
> Message:
> #end
> </body>
> </html>
--
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: [email protected]
For additional commands, e-mail: [email protected]