I've tried to include javascript file in ftl (Freemarker Template)
but I keep getting this message
I'm using Spark framework which has Jetty server. This happens every time I try to include any file, even just an image. With css I've used <#include "style.css">
but it's workaround.
Is there any way to include scripts?
You must use staticFileLocation to tell where static files like *.js and *.css are placed, so spark will serve them directly.
Secondly, don't include css like that:
<#include "css/style.css">
because it will end up with css rules inside <head>
tag, which will not work.