You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sergey Livanov <Se...@ukrpost.net> on 2005/02/28 22:16:43 UTC

Frames question

Please give me a peace of advice.

I have an application designed with Struts. There are 2 parts in the page. On
the left side there is a tree by JavaScript and on the right the data which
are accepted from tree elements. To avoid duplication when data are
downloaded into the tree I have decided to put the page into the frame.
But before the elements were

<c:out value='${bean.prop}' /> и
<html:select
options
</html:select> and they worked successfully
in this case I am not able to take data out.

Are there any problems to work with frames?


regards
 Sergey                          mailto:Sergey.Livanov@ukrpost.net


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Frames question

Posted by Leon Rosenberg <st...@anotheria.net>.
There are no problems working with frames, but you have to consider, that
each frame is a separate http request.
So, if you have a frameset with two frames in it, lets call them left and
right, your browser actually 
sends 3 requests to your webserver.

To do it the struts conform way (or what I think the struts conform way is),

you have to create 3 actions:
showFramesetAction, showLeftFrame action, showRightFrame action.
showFramesetAction can be just a simple forward action, returning the
frameset definition like
<frameset cols="X,Y">
  <frame ... name="right" src="showLeftFrame"/>
  <frame ... name="right" src="showRightFrame"/>
</frameset>

The showLeftFrameAction should put the beans you need for html select in the
LeftFrame.jsp, which renders your menu, in the request.
The showRightFrameAction should put the beans for the right side. 
For further requests you will only need one action, which presents ist
information in the right frame, targeting it with html 'target="right"', but
I think you know it's yourself.

What's important, is to remember that your frameset and the contained
frames, are downloaded by the browser in separate requests, so 
if you put something in the request in showFramesetAction, you will not be
able to access it from LeftFrame.jsp or RightFrame.jsp (same applies for
internal frames).

Regards
Leon

P.S. thanx again for you help with encoding :-)


> I have an application designed with Struts. There are 2 parts 
> in the page. On the left side there is a tree by JavaScript 
> and on the right the data which are accepted from tree 
> elements. To avoid duplication when data are downloaded into 
> the tree I have decided to put the page into the frame.
> But before the elements were
> 
> <c:out value='${bean.prop}' /> и
> <html:select
> options
> </html:select> and they worked successfully in this case I am 
> not able to take data out.
> 
> Are there any problems to work with frames?
> 
> 
> regards
>  Sergey                          mailto:Sergey.Livanov@ukrpost.net
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org