JavaScript resides on the client. JSP/JSF resides on the server. To get data from the server - or to update the server, the JavaScript has to make AJAX requests.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.