IntelliJ does not recognize "/spring.ftl"

My IntelliJ will only recognize "spring.ftl" and not "/spring.ftl" in Freemarker templates using Spring.  The latter is correct where as the former will not work at runtime as the templates I'm working on are not in the root Freemarker directory.  For example:


  <bean id="freemarkerConfig" >
    <property name="defaultEncoding" value="UTF-8"/>
    <property name="templateLoaderPaths">
      <array value-type="java.lang.String">
        <value>...other directories...</value>


  <#import "/spring.ftl" as spring>
  ... other freemarker code ...


  <#import "spring.ftl" as spring>
  ... other freemarker code ...

The first is correct and will work at runtime, however it is unrecognized in IntelliJ and code completion will not work.  The second is incorrect and will fail at runtime, however IntelliJ does recognize and code completion works.  Do I have IntelliJ misconfigured or is this a bug?  Currently we are stuck using the wrong import to get code completion working and then changing it to the right import before trying to run it.
Comment actions Permalink

This is in 10.5 and was also happening in 10.0.3.

Comment actions Permalink

I still cannot get this to work.

Comment actions Permalink

If it is a bug and not a misconfiguration you could at least use a better workaround of using ../spring.ftl at coding-time and run-time.

Comment actions Permalink

"../spring.ftl" does not work either.  

The only thing that does work is "spring.ftl".


Please sign in to leave a comment.