Problem with conditional rendering in Velocity
See original GitHub issueHi tipsy,
did you noticed that the following code:
#if($loginRedirect)
<input type="hidden" name="loginRedirect" value="$loginRedirect">
#end
does not render anytning?
Note that the previous code has been taken from your project https://javalin.io/tutorials/website-example.
I’ve tested it and concluded that the #if
block can render e.g. <p>
tag, but not the <input>
tag.
It is clear that the problem is related to Velocity and not to Javalin, but I wonder can you help with this and probably update your project?
Tested with Velocity 2.0 and 2.3 and the result is the same.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Velocity syntax for conditional statement with two or more ...
I thought this would be simple, but I am trying to check for multiple conditions on an "if" statement in Velocity using the...
Read more >User Guide - Apache Velocity Engine
Rendering ¶. The final value resulting from each and every reference (whether variable, property, or method) is converted to a String object when...
Read more >Connect two conditions in one #elseif() statement
length()==0) AND ($suspectYesNo.value.contains("true")) in one #elseif(). Or did I define the boolean wrong? #if($p2.
Read more >Writing conditional statement in Velocity Markup Fail - Forums
The condition for displaying the the down arrow is that the nav item name is either “Tools” or “Administration”.
Read more >Velocity Templates Developer Guide
If a problem is discovered with a template that renders a particular control, or the control object has been updated and the template...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t have time to debug that particular application, but I can give you a more general tip. It’s much easier to debug what’s going on with a template engine if you remove Javalin and the browser from the equation. Implement your own template engine method that just print templates directly to system out.
That is very strange, I would report it as a bug to Firefox. I’m glad you figured it out, I will close the ticket now 😃