RE: Struts and frames: what about the request scope?

2003-10-30 Thread Andrew Hill
Its not found in the request scope of the frames because each frame has a
DIFFERENT request. The browser will sent a seperate simultaneous request for
each individual frame.

If using session scope beware of potential concurrency issues as you will
have multiple threads accessing the same form object. Probably wont be an
issue if your just reading values for display though.

-Original Message-
From: Jeroen Breedveld [mailto:[EMAIL PROTECTED]
Sent: Thursday, 30 October 2003 18:49
To: [EMAIL PROTECTED]
Subject: Struts and frames: what about the request scope?


Hi all,

I'm trying to use struts with frame but the problem I have is that forms
disappear from the request scope when I forward to an jsp containing a
frameset to other actions like this:





  
  





The frameset-jsp.page contains a frameset like this:


  
  


Now in the actions topFrame and bottomFrame the form SomeForm does not
appear in the request scope. Why is this? Rightnow I solved it by
putting SomeForm in the session scope is that the only solution? I don't
think that is a clean one anyway.

Thanks for any help and regards,

Jeroen

--

X-Hive Corporation
e-mail: [EMAIL PROTECTED]
phone: +31 10 2818080
http://www.x-hive.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts and frames: what about the request scope?

2003-10-30 Thread Kris Schneider
Here's another possibility. In the action that forwards to frameset-page.jsp,
create a Map (or Maps) containing the request parameters you want submitted to
the topFrame and bottomFrame actions. Save this Map as a request attribute.
Then, in frameset-page.jsp:


  
  


If the parameters you want to propogate are already contained in an action form,
you could use either BeanUtils.describe of DynaActionForm.getMap to create the
Map for you.

Quoting George Steimer <[EMAIL PROTECTED]>:

> I had this same problem on the project I am working on.  Based on the
> functionality of the application, I could not put the form in session scope. 
> I got around this problem by having each frame call an action that recreated
> the form bean in request scope and then forwarded to the frame jsp.
> 
> George
> 
> > Its not found in the request scope of the frames because each frame has a
> > DIFFERENT request. The browser will sent a seperate simultaneous request
> for
> > each individual frame.
> > 
> > If using session scope beware of potential concurrency issues as you will
> > have multiple threads accessing the same form object. Probably wont be an
> > issue if your just reading values for display though.
> > 
> > -Original Message-
> > From: Jeroen Breedveld [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, 30 October 2003 18:49
> > To: [EMAIL PROTECTED]
> > Subject: Struts and frames: what about the request scope?
> > 
> > 
> > Hi all,
> > 
> > I'm trying to use struts with frame but the problem I have is that forms
> > disappear from the request scope when I forward to an jsp containing a
> > frameset to other actions like this:
> > 
> > 
> > 
> > 
> >  >input="/somePage.do"
> >   name="SomeForm" scope="request"
> > type="com.mycompany.actions.SomeAction">
> >   
> >   
> > 
> > 
> > 
> >  > forward="/WEB-INF/pages/frameset-page.jsp"/>
> > 
> > The frameset-jsp.page contains a frameset like this:
> > 
> > 
> >> action="topFrame.do"/>
> >> action="bottomFrame.do"/>
> > 
> > 
> > Now in the actions topFrame and bottomFrame the form SomeForm does not
> > appear in the request scope. Why is this? Rightnow I solved it by
> > putting SomeForm in the session scope is that the only solution? I don't
> > think that is a clean one anyway.
> > 
> > Thanks for any help and regards,
> > 
> > Jeroen
> > 
> > --
> > 
> > X-Hive Corporation
> > e-mail: [EMAIL PROTECTED]
> > phone: +31 10 2818080
> > http://www.x-hive.com

-- 
Kris Schneider 
D.O.Tech   

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Struts and frames: what about the request scope?

2003-10-30 Thread Jose Ramon Diaz
hi all,

 We use Frames in our application. We have had this problem a we use
different approach.
 We suppose the form data is ONLY needed for the action, so the action
executes and change the model as needed. The action decides which is the
next page, and if it can have frames it sets a variable "next" in session,
which indicates what the frames that must be loades in this way:

 Every frame in frameset is redirected to an special action frames.do with
two parameters: the place where the frame is loaded and the "next" variable.
For example:


">
">


  And we have implemented the frames.do action to know which JSP must be
loaded, with parameters position and next. In fact, the page that must be
loaded is written in struts-config.xml in this way:

   
  
  ç



So the frames.do makes a forward to the String created with "position+next"
(the two parameter of frames.do) and we can establish the JSP in the xml
file...

Is this a complicated way of doing this? Sure,... above all because of my
poor english :-)


 Regards

Jose R. Díaz


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: RE: Struts and frames: what about the request scope?

2003-10-30 Thread George Steimer
I had this same problem on the project I am working on.  Based on the functionality of 
the application, I could not put the form in session scope.  I got around this problem 
by having each frame call an action that recreated the form bean in request scope and 
then forwarded to the frame jsp.

George

> Its not found in the request scope of the frames because each frame has a
> DIFFERENT request. The browser will sent a seperate simultaneous request for
> each individual frame.
> 
> If using session scope beware of potential concurrency issues as you will
> have multiple threads accessing the same form object. Probably wont be an
> issue if your just reading values for display though.
> 
> -Original Message-
> From: Jeroen Breedveld [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 30 October 2003 18:49
> To: [EMAIL PROTECTED]
> Subject: Struts and frames: what about the request scope?
> 
> 
> Hi all,
> 
> I'm trying to use struts with frame but the problem I have is that forms
> disappear from the request scope when I forward to an jsp containing a
> frameset to other actions like this:
> 
> 
> 
> 
> input="/somePage.do"
>   name="SomeForm" scope="request"
> type="com.mycompany.actions.SomeAction">
>   
>   
> 
> 
> 
>  forward="/WEB-INF/pages/frameset-page.jsp"/>
> 
> The frameset-jsp.page contains a frameset like this:
> 
> 
>action="topFrame.do"/>
>action="bottomFrame.do"/>
> 
> 
> Now in the actions topFrame and bottomFrame the form SomeForm does not
> appear in the request scope. Why is this? Rightnow I solved it by
> putting SomeForm in the session scope is that the only solution? I don't
> think that is a clean one anyway.
> 
> Thanks for any help and regards,
> 
> Jeroen
> 
> --
> 
> X-Hive Corporation
> e-mail: [EMAIL PROTECTED]
> phone: +31 10 2818080
> http://www.x-hive.com
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]