You can't. JSP runs on the server in order to format the HTML page to be sent to the client. Any JavaScript needs to execute within the browser, long
after the JSP has executed and the page has been sent as the request response. Perhaps
this article can help clear up how JSP processing works.
Perhaps it'd be best to back up a bit and tell us what the real problem you are trying to solve is. That way a solution that can work can be devised.
[ June 11, 2008: Message edited by: Bear Bibeault ]