Servlet/JSP is serverside, javascript is client side. You are asking about two different things.
Anything that is written out to the page can be accessed via javascript on that page but once the page is written the Servlet/JSP's work is done (until the next request that is).
I need the jsp method to store a value in a hidden field so that a javascript function can process that value.
Servlet/JSP "store" hidden fields by written them out as hidden fields in HTML.