Spring Velocity JavaScript can they work together?
I’m trying to make an internationalized js-message using following code from the .js file:
where springMessage is a velocity macro:Code:confirm('#springMessage("saveIfChanged@generic.translations")')
The properties of the view resolver we use:Code:#macro( springMessage $code ) $springMacroRequestContext.getMessage($code)#end
This is resulting inCode:<property name="cache"><value>${web-settings.viewResolver.cache}</value></property> <property name="prefix"><value>/WEB-INF/js/</value></property> <property name="suffix"><value>.js</value></property> <property name="exposeSpringMacroHelpers"><value>true</value></property> <property name="acegiSecurityHelper"><ref bean="acegiSecurityHelper"/></property> <property name="order"><value>2</value></property>Code:confirm('$springMacroRequestContext.getMessage($code)'))
We use the macro in regular .vm files with no problems.
What are we missing here?


Reply With Quote