This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Currently I have a jsp page with three frames using <frameset> and <frame> tags. There are three action classes and one actionform for all three frames. The problem occurs when I try to submit the page containing the frames. The submit button is in the third frame. When this button is pressed it must check the data in the second frame and do adds, updates, or deletes for the given info in the second frame. The problem is I can not keep one instance of the actionform for all three frames. It keeps creating a new instance when it goes from the button frame to the body frame. How can I get around this problem and keep one instance of my actionform for all three frames.
Well, since no one else is going to take a crack at this one... here goes.
I don't understand what you mean that each frame is creating its own ActionForm. If you have only one request being made from the browser, there is no possible way this could happen from within the Struts framework. What is happening to make this happen or at least make you believe this is happening???
Frames are evil. Sorry, had to say it! [ June 09, 2004: Message edited by: Marc Peabody ]
ha, are they evil. well, depends how you look at it. They can be a nightmare for maintenance, if you have one frame update the other and you wnat to acces data that has changed on one frame in the other. Then you will realize that you need to update a frame and that another needs updating as well. Then what you do is a onload in the body and hey there you go. Now you are in a sliding scale. One frame updates the other and the waterfall starts. Now you reached exactly nothing. The customer will see two or three frames change inexplicably and you as a programmer suddenly dont know where the updates are coming from. And then suddenly they are updating each other in a circle.
And you know what ? One frame is one http request. So if you update two frames you have two http request, going to use the bandwidth. It just takes up time exponentionally if more frames need updating.