Search code examples
javahtmlservletstemplate-enginerythm

Setting a variable using another variable in Rythm


I have a Rythm template that looks like:

...Some HTML...
@get("title")
...Some More HTML...

And then I use it in another file, which is called from a Java Servlet. The file looks like:

@extends(../root.html)
@args String leTitle
@set(title = @leTitle)

Hello @leTitle !

Where, leTitle is given to this HTML file from the Servlet in args.

The variable leTitle is fine when used in the body, but when setting the title variable, it says:

org.rythmengine.exception.CompileException: Syntax error on token "@", delete this token

Removing it from the title makes things work. So, should the title be a static string? Or is there a way to initialise it as a variable?


Solution

  • try @set(title = leTitle). No @ before leTitle