Reputation: 1476
I'm interested can I store into client side for example large hashmap or a List? I need something like a temporary cache to store user session data.
Upvotes: 2
Views: 805
Reputation: 1109532
In theory, you could use HTML5 client side storage in JavaScript. So far now, no JSF components exists which could do the job transparently. You'd need to write all the necessary JS code yourself or grab jQuery.
All JSF as being a HTML code generator can do for you is to print Java objects in JSON format as a JavaScript variable assignment with help of a JSON library such as Google Gson.
<h:outputScript>var data = #{bean.dataAsJSON};</h:outputScript>
The getDataAsJSON()
should just return an already converted JSON string.
Upvotes: 3