0

I can access Spring Bean in FreeMarker Template (FTL) this way:

String: '${myBean.myInfo.stringValue}'

Map: <#list myBean.myMap?values as value>

How to access these in JavaScript?

user7331530
  • 815
  • 1
  • 12
  • 21
  • 5
    FreeMarker runs on the server, while JavaScript runs on the client. The Internet is between them. You have to explicitly transmit data between the two. – Pointy Mar 27 '19 at 12:46
  • 1
    Possible duplicate of [What is the difference between client-side and server-side programming?](https://stackoverflow.com/questions/13840429/what-is-the-difference-between-client-side-and-server-side-programming) – VLAZ Mar 27 '19 at 12:50
  • either do as @Poinky described or simply hardcode (eg JSON encode it) the data using FTL into the webpage so that javascript can find it and read it – Nikos M. Mar 27 '19 at 13:31

0 Answers0