How to configure the freemarker template path or what's the default path?

Answered

The freemarker syntax highlight is very good feature.

 

But for  "

<#include "abc/abc.ftl" />

The Intellij Idea can't tell where to find the file, it will warning "cannot resolve directory"

so, please tell where it will find the file? or how to configure the path?


thanks

0
3 comments

Thanks, after some research, I find an official solution with Intellij Idea 2017.2 Ultimate version.

1. find a red warning , for example ,

<#include "/common/global.ftl" />

use " OPTION + Enter (Mac OSX)" , will popup a windows, just following the step:

 

2.   choose  "Define template root in comment (global)

it will create a new file, under "/src/main/resources" ,  filename is  freemarker_implicit.ftl , update the path by your setting

[#ftl]
[#-- @implicitly included --]
[#-- @ftlroot "../webapp/WEB-INF/pages" --]

 

3. if need, use  File -> Invalidate Caches/Restart 

4. use it . just like 

<#include "/common/header.ftl" />

 

 

 

0

Please sign in to leave a comment.