you need to use javascript...
you can add the script at the end of the
jsp this requires the hard coding the form bean name you mapped to in your action (if you have only 1 form on that page, you can use form[0]). it also assumes that "fileName" is the property defined for html:file. you can look at the generated HTML to find exactly what you need.