Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to set a debug point in FreeMarker template file?

I have a lot of coding in FreeMarker template files for view layer in my app.

I was wondering if I can set a debug point with Eclipse. Is there any good plugin that I can use to debug FreeMarker template files?

like image 751
Neeraj Avatar asked Oct 01 '13 21:10

Neeraj


People also ask

What is the use of FreeMarker template?

FreeMarker is a template engine, written in Java, and maintained by the Apache Foundation. We can use the FreeMarker Template Language, also known as FTL, to generate many text-based formats like web pages, email, or XML files.

How do I comment in FreeMarker template?

Comments: <#-- and --> Comments are similar to HTML comments, but they are delimited by <#-- and -->. Comments will be ignored by FreeMarker, and will not be written to the output.

What is FTL FreeMarker?

Templates are written in the FreeMarker Template Language (FTL), which is a simple, specialized language (not a full-blown programming language like PHP). Usually, a general-purpose programming language (like Java) is used to prepare the data (issue database queries, do business calculations).

How do you generate random numbers in FreeMarker?

Freemarker does not provide a random number generator at the moment. You can implement a naive random number generator using the time ( . now ) as a seed, but it should never be a critical part of your program.


1 Answers

As far as I know, you cannot. A template file is a plain text file that the template engine reads into memory and then uses to produce a document that it writes to the response. It's not actually executable code. You can put a breakpoint in the template engine code and follow along what it replaces and how.

like image 118
Sotirios Delimanolis Avatar answered Oct 25 '22 13:10

Sotirios Delimanolis