scalalambdamustachefinatra

Problems with finatra and mustache lambdas


I am experiencing some problems in using mustache lambdas within my finatra project. I would like to create my own translation function so I created something like this

import com.github.mustachejava.TemplateFunction

class TranslateFunction extends TemplateFuction {
  override def apply(input:String):String = {
   println("Translate " + input)
   return input
  }
}

but I cannot build it, sbt complains

[error] not found: type TemplateFuction
[error]   class TranslateFunction extends TemplateFuction {
[error]                                   ^

I am using finatra version 1.5.3 plus scala 2.10.3, does anyone has a project that works fine with finatra and mustache lambdas?


Solution

  • There's a typo in your class declaration ("TemplateFunction" is misspelled, it's missing a 'n'). This works for me:

    import com.github.mustachejava.TemplateFunction
    
    class TranslateFunction extends TemplateFunction {
      override def apply(input:String):String = {
        println("Translate " + input)
        return input
      }
    }