And what, pray tell, is your definition of a "dialog box". There is no standard HTML element with that designation, so it must be something *YOUR CODE* is creating.
And that being so, how can we guess what you are doing wrong?
If you want help, you will have to show your code.
And *PLEASE* do *NOT* post your JSP code. Instead bring up your page(s) in your browser, click on the browser's VIEW menu and then on the SOURCE or PAGE SOURCE menu item. Copy/paste the HTML that the browser is seeing and using to here.
Or, even better, give us a live URL to look at.
*** AS A GUESS ***
I would tell you to simply have your button's onclick handler call the code in your <iffame>, rather than duplicating the code in both JSP pages.
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.