title: Calling Java class's method from javascript in a freemarker template
body: <p>I have a <strong>freemarker</strong> template with <strong>javascript</strong> in it, and I'm using <strong>spring mvc</strong> to pass in a java object "emailer". </p>
  
  <p>Somehow, in this freemarker template, I want to call the emailer object's "sendEmail(params, ..)" method from javascript within the freemarker template. I know how to call java methods from freemarker (the regular way - for example: <a href="https://stackoverflow.com/questions/1362343/how-do-i-call-java-methods-on-an-object-from-a-freemarker-template">How do I call java methods on an object from a FreeMarker template?</a>) , but I don't know how to do it from <strong>within the javascript</strong>. </p>
  
  <p>Is this even possible? If so, how?
  And if it's not, what are some alternatives? </p>
  
  <p>The overall goal was to get a value from a dropdown list (using javascript), and then using that value in the java method that gets called when a button is pressed. </p>
  
  <p>Thanks in advance! If more info is needed, I'd be happy to provide it. </p>