Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts and Frames

 
Jason Cromer
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Peter Venema
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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

Greeting,

Peter
 
frisode jonge
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just by curiosity...
why frames are so evil???

I know they require a extra effort, but do they have a lot more cons?
 
Rene Smith
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think frames are evil. Not only are they a maintenance (and development) nightmare, but users primarily HATE them!!
 
bas duijzings
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic