Since you need to perform some javaScript tasks when you submit the form for Window B, I'd suggest changing your <html:submit> to an <html:button>. Then include submitting the form as part of your onclick tasks (this.form.submit()).
I've had problems, though, with closing the window immediately after submitting a form. Sometimes the form doesn't get submitted before the window closes. There are two ways to handle this. One is to use the setTimeoutValue() javascript method to wait a second or two before submitting. The other is not to close the window at all in the submitting
JSP, and to have the action forward to a page that does nothing but close the window in the onload method of the <body> tag.