You just can't do that in Javascript (unless you use Ajax and request messages from the server). Once the HTML Response is flushed to the client you can't have javascript access the resource bundle (Javascript is meant for client side & resource bundles are at server side). . Here is how you can solve this issue.
- Have Javascript generated through
JSP. You populate the messages from resource bundle into a javascript array through JSP.