You cannot call a Javabean from Javascript.
The JSP page is executed on the server in order to render the HTML page to send to the browser. This is the point at which any
Java on the page is executed -- including the snippet inside your Javascript function.
The HTML page is sent to the browser where, as a result of user action, your Javascript executes. The bean was never on the client, and has probably long been gone on the server.
If you perform a View Source in your browser, you will see that your Javascript function has no mechanism to call the Javabean, but that the HTML sent to page has the result of calling that bean (on the server) embedded in your page.
What it comes down to is this: you have server-side technology, and you have client-side technology, and you cannot mix the two.
hth,
bear