jQuery in Action, 3rd edition
The moose likes Struts and the fly likes Struts and Frames Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts and Frames" Watch "Struts and Frames" New topic

Struts and Frames

Jason Cromer

Joined: Jun 09, 2004
Posts: 1
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.
Marc Peabody
pie sneak

Joined: Feb 05, 2003
Posts: 4727

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 ]

A good workman is known by his tools.
Peter Venema

Joined: Dec 02, 2002
Posts: 6

Maybe, if you realy need to use frames the <IFRAME> tag offers possibilities? Is better in combination with struts and tiles than frames.


frisode jonge
Ranch Hand

Joined: Dec 30, 2003
Posts: 34
check if your actionform is maintained by the sessionscope instead of requestscope.

also, frames are evil.
maybe try tiles, which in your case keeps all data in one actionform.
Leandro Melo
Ranch Hand

Joined: Mar 27, 2004
Posts: 401
Just by curiosity...
why frames are so evil???

I know they require a extra effort, but do they have a lot more cons?

Leandro Melo
SCJP 1.4, SCWCD 1.4
Rene Smith

Joined: Jun 10, 2004
Posts: 21
I think frames are evil. Not only are they a maintenance (and development) nightmare, but users primarily HATE them!!
bas duijzings
Ranch Hand

Joined: Apr 07, 2004
Posts: 83
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.

do i still make sense ?

have a nice one
I agree. Here's the link: http://aspose.com/file-tools
subject: Struts and Frames
jQuery in Action, 3rd edition