If you can at all avoid it, do not use
Struts 1. It is
past end of life , unsupported, has not had an update in 6 years and has serious architectural issues.
That said, you will not be able to use JavaScript to directly write a variable in an Action to a JSP page because the Action runs on the server and the JavaScript runs in the web browser. You can, however, write the value somewhere on the page where JavaScript can use the value using a Struts tag (
bean:write perhaps) and the JavaScript can do so when it is run in the browser.