title: Get userPrincipal in Javascript
body: <p>I need to get userPrincipal inside a piece of Javascript code. My app currently uses Dojo on the client side and servlets on the server side. I am not using JSF, nor JSP (and if possible I would try to avoid using it only for this purpose), nor JQuery (I would avoid mixing JQuery with Dojo).
  I have read this interesting post <a href="https://stackoverflow.com/questions/2547814/mixing-jsf-el-in-a-javascript-file">Mixing JSF EL in a JavaScript file</a> . Following the idea #1, I have written a Bean but I am not sure on how to embed the call to the Bean in my (quite long) js file.</p>