You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Antonio Petrelli <br...@tariffenet.it> on 2006/08/29 09:30:32 UTC

Re: [jira] Created: (STR-2939) Provide a conversation scope (syn: Flash scope, dialog scope) object to store data between requests.

Michael Jouravlev (JIRA) ha scritto:
> In addition to standard J2EE scopes (page for JSP, request, session and application) provide a new scope object that would hold data between requests. Similar facilities in Tapestry and Stripes are called FlashScope, Struts 1 will call it as Conversation Scope.
>   

Micheal
I know that's a bit out of "scope", but now I'm guessing if there is 
space to incubate Scopes:
http://scopes.sourceforge.net/
The "flash" scope is called "click" scope:
http://scopes.sourceforge.net/documentation/more-scopes/click-scope.html
I think it could be used among a large set of frameworks, including 
Struts 1, Struts 2 and Shale.
What do you think?

Ciao
Antonio


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


[OT] Re: [jira] Created: (STR-2939) Provide a conversation scope (syn: Flash scope, dialog scope) object to store data between requests.

Posted by Antonio Petrelli <br...@tariffenet.it>.
Antonio Petrelli ha scritto:
> Micheal


Whoops sorry, I mistyped your name ;-)


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


Re: [jira] Created: (STR-2939) Provide a conversation scope (syn: Flash scope, dialog scope) object to store data between requests.

Posted by Antonio Petrelli <br...@tariffenet.it>.
Martin Cooper ha scritto:
> Please, if we're going to consider adding a flash / click / dialog /
> whatever scope, let's decouple it from redirection. Such an intermediate
> scope has potential uses that have nothing to do with redirection

Can you make an example? Probably you don't need a "conversation" scope 
but something else.

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


Re: [jira] Created: (STR-2939) Provide a conversation scope (syn: Flash scope, dialog scope) object to store data between requests.

Posted by Michael Jouravlev <jm...@gmail.com>.
On 8/29/06, Martin Cooper <ma...@apache.org> wrote:
> Please, if we're going to consider adding a flash / click / dialog /
> whatever scope, let's decouple it from redirection. Such an intermediate
> scope has potential uses that have nothing to do with redirection, so it
> needs to be workable even for those who happen to dislike redirects
> intensely. ;-)

I don't think this is possible. The whole point for Conversation Scope
is that it automatically cleans up after the roundtrip. It is made for
those who hate storing stuff in session, but who agree that
redirection provides better user experience in terms of navigation
back and forth and helps to prevent implicit resubmits.

For cases other than redirection please create your own scope ;-)
Maybe Antonio's idea of integrating his Scopes project actually does
make sense. I personally don't need other scopes, I will be pretty
happy with cleaned-after-redirect Conversation scope :)

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


Re: [jira] Created: (STR-2939) Provide a conversation scope (syn: Flash scope, dialog scope) object to store data between requests.

Posted by Martin Cooper <ma...@apache.org>.
On 8/29/06, Michael Jouravlev <jm...@gmail.com> wrote:
>
> On 8/29/06, Antonio Petrelli <br...@tariffenet.it> wrote:
> > Michael Jouravlev (JIRA) ha scritto:
> > > In addition to standard J2EE scopes (page for JSP, request, session
> and application) provide a new scope object that would hold data between
> requests. Similar facilities in Tapestry and Stripes are called FlashScope,
> Struts 1 will call it as Conversation Scope.
> > >
> >
> > Micheal
> > I know that's a bit out of "scope", but now I'm guessing if there is
> > space to incubate Scopes:
> > http://scopes.sourceforge.net/
> > The "flash" scope is called "click" scope:
> > http://scopes.sourceforge.net/documentation/more-scopes/click-scope.html
> > I think it could be used among a large set of frameworks, including
> > Struts 1, Struts 2 and Shale.
> > What do you think?
>
> I need just one scope, so I don't think that bringing in a whole
> library just for one scope makes sense. Also, your library depends on
> Java5, while Struts 1 is built on Java 1.4. On the other hand, you
> already have done the work. Also, your idea of storing Click scope in
> the request and pushing it to session only between requests is better
> than mine idea of storing it in the session: less issues with garbage
> collection and the same ability to have multiple instances of, say,
> formbeans like with request scope.
>
> I have another suggestion: storing data right in the request object
> instead of having a dedicated scope object. Then, on redirection,


Please, if we're going to consider adding a flash / click / dialog /
whatever scope, let's decouple it from redirection. Such an intermediate
scope has potential uses that have nothing to do with redirection, so it
needs to be workable even for those who happen to dislike redirects
intensely. ;-)

--
Martin Cooper


pushing appropriate items to the session, using item's names. Thus,
> the Click scope control object would store names instead of storing
> objects themselves. This way we would not have to do anything to
> update the search chain page->request->session->app for Struts tags
> and JSTL tags. For the tags, Click scope would be just a regular
> request scope.
>
> I would also prefer zero configuration, thus better integration with
> Struts. Therefore it would be great if you wrote a separate version
> specifically for Struts with full integration, or I can do it myself,
> taking your code as the basis.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

Re: [jira] Created: (STR-2939) Provide a conversation scope (syn: Flash scope, dialog scope) object to store data between requests.

Posted by Michael Jouravlev <jm...@gmail.com>.
On 8/30/06, Antonio Petrelli <br...@tariffenet.it> wrote:
> Michael Jouravlev ha scritto:
> > I have another suggestion: storing data right in the request object
> > instead of having a dedicated scope object. Then, on redirection,
> > pushing appropriate items to the session, using item's names. Thus,
> > the Click scope control object would store names instead of storing
> > objects themselves. This way we would not have to do anything to
> > update the search chain page->request->session->app for Struts tags
> > and JSTL tags. For the tags, Click scope would be just a regular
> > request scope.
>
> Good point, I will code it ASAP. Thank you for the suggestion :-)
>
> > I would also prefer zero configuration, thus better integration with
> > Struts. Therefore it would be great if you wrote a separate version
> > specifically for Struts with full integration, or I can do it myself,
> > taking your code as the basis.
>
> Currently I am going to write a bit of integrations. At the moment I
> only wrote integration with Spring 2.0 IoC (even the new Spring has
> scopes :-) )

Hi Antonio,

I looked through your code, it is quite clear, so I started pulling
needed stuff from your library and sticking it into Struts. I also
want this scope to be available for ActionForms in action mapping
definition, and for errors/messages.

Michael.

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


Re: [jira] Created: (STR-2939) Provide a conversation scope (syn: Flash scope, dialog scope) object to store data between requests.

Posted by Antonio Petrelli <br...@tariffenet.it>.
Michael Jouravlev ha scritto:
> I need just one scope, so I don't think that bringing in a whole
> library just for one scope makes sense.

I agree...

> Also, your library depends on
> Java5, while Struts 1 is built on Java 1.4.

I could branch the code for Java 1.4 anyway. For some strange reasons I 
decided to use Java 5, though I really needed only Generics.

> I have another suggestion: storing data right in the request object
> instead of having a dedicated scope object. Then, on redirection,
> pushing appropriate items to the session, using item's names. Thus,
> the Click scope control object would store names instead of storing
> objects themselves. This way we would not have to do anything to
> update the search chain page->request->session->app for Struts tags
> and JSTL tags. For the tags, Click scope would be just a regular
> request scope.

Good point, I will code it ASAP. Thank you for the suggestion :-)

>
> I would also prefer zero configuration, thus better integration with
> Struts. Therefore it would be great if you wrote a separate version
> specifically for Struts with full integration, or I can do it myself,
> taking your code as the basis.

Currently I am going to write a bit of integrations. At the moment I 
only wrote integration with Spring 2.0 IoC (even the new Spring has 
scopes :-) )
Just a note (I don't know if it will be of interest for you): Scopes has 
been released with ASL 2.0, but "window" scope depends on "HTML Parser", 
released with LGPL, though the code of "window" scope itself is released 
with ASL.

Ciao
Antonio

P.S. Michael, congratulations for your "state management" wiki, i really 
liked it :-)

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


Re: [jira] Created: (STR-2939) Provide a conversation scope (syn: Flash scope, dialog scope) object to store data between requests.

Posted by Michael Jouravlev <jm...@gmail.com>.
On 8/29/06, Antonio Petrelli <br...@tariffenet.it> wrote:
> Michael Jouravlev (JIRA) ha scritto:
> > In addition to standard J2EE scopes (page for JSP, request, session and application) provide a new scope object that would hold data between requests. Similar facilities in Tapestry and Stripes are called FlashScope, Struts 1 will call it as Conversation Scope.
> >
>
> Micheal
> I know that's a bit out of "scope", but now I'm guessing if there is
> space to incubate Scopes:
> http://scopes.sourceforge.net/
> The "flash" scope is called "click" scope:
> http://scopes.sourceforge.net/documentation/more-scopes/click-scope.html
> I think it could be used among a large set of frameworks, including
> Struts 1, Struts 2 and Shale.
> What do you think?

I need just one scope, so I don't think that bringing in a whole
library just for one scope makes sense. Also, your library depends on
Java5, while Struts 1 is built on Java 1.4. On the other hand, you
already have done the work. Also, your idea of storing Click scope in
the request and pushing it to session only between requests is better
than mine idea of storing it in the session: less issues with garbage
collection and the same ability to have multiple instances of, say,
formbeans like with request scope.

I have another suggestion: storing data right in the request object
instead of having a dedicated scope object. Then, on redirection,
pushing appropriate items to the session, using item's names. Thus,
the Click scope control object would store names instead of storing
objects themselves. This way we would not have to do anything to
update the search chain page->request->session->app for Struts tags
and JSTL tags. For the tags, Click scope would be just a regular
request scope.

I would also prefer zero configuration, thus better integration with
Struts. Therefore it would be great if you wrote a separate version
specifically for Struts with full integration, or I can do it myself,
taking your code as the basis.

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