I have a freemarker template with javascript in it, and I'm using spring mvc to pass in a java object "emailer".
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: How do I call java methods on an object from a FreeMarker template?) , but I don't know how to do it from within the javascript.
Is this even possible? If so, how? And if it's not, what are some alternatives?
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.
Thanks in advance! If more info is needed, I'd be happy to provide it.