How can I initialize a complicated JavaScript data structure from Java?
I have a JavaScript data structure that, if hard-coded, would look something like this:
WorkSchedule.js looks like this:
However, the specific values will be pulled from a database by my Java code, which would then initialize the JavaScript data structure. Unfortunately, I don't know how to do that.
In the past, I would place values in hidden fields and then initialize variables from those hidden fields. However, this involves a far more complicated data structure (hashes, arrays, objects, etc).
How could I do this? (I'm using Java 5 and JavaServer Faces, if that matters.)
Thanks!