struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sloan Seaman" <sl...@sgi.net>
Subject Re: How do you keep your session junk free?
Date Fri, 07 Mar 2003 16:33:22 GMT
I kinda have a class that does that if you want.

I have an Action called ChainAction that can call N number of actions in a
row and passes the same form and request info through all the actions.

The last action in the chain is then used to do a foward to whatever.

This is how I control all application flow via the struts-config file.

Example:
  <action path="/app/campaign/promotion/type/pantryLoading/introAddChain"
   className="com.symbol.mobilecommerce.analysis.struts.ChainActionMapping"
     type="com.symbol.mobilecommerce.analysis.struts.ChainAction"
   name="pantryLoadingIntro"
   >
   <set-property property="ROLE" value="admin"/>
   <set-property property="PROPERTY_NAME" value="action"/>
   <set-property property="CHAIN" value="Do Delete :
/app/campaign/promotion/type/pantryLoading/introSaveMessageAdd,
/app/campaign/promotion/type/pantryLoading/deleteBitmapAdd,
/app/campaign/promotion/type/pantryLoading/introAddPage"/>
   <set-property property="CHAIN" value="Add Bitmap :
/app/campaign/promotion/type/pantryLoading/introSaveMessageAdd,
/app/campaign/promotion/type/pantryLoading/addBitmapAdd,
/app/campaign/promotion/type/pantryLoading/introEditPage"/>
   <set-property property="CHAIN" value="Next:
/app/campaign/promotion/type/pantryLoading/introSaveMessageAdd,
/app/campaign/promotion/type/pantryLoading/messageTypeAddChain"/>
   <forward name="PAGE_CHAIN_ERROR"
path="/app/campaign/promotion/type/pantryLoading/introAddPage.do"/>
   <forward name="PAGE_ACCESS_DENIED"
path="/app/campaign/promotion/mainPage.do"/>
  </action>

This action does security first (we have a custom system that does role
based security down to the action level).  If the user does not have access
it send them up the chain one step.  They continue up the chain till they
hit a point where they do have access.  This way we get them to ass deep as
they can go (get your mind out of the gutter). Anway..

The chains work by defining a PROPERTY_NAME that relates to an any element
in a form.  In this case, submit buttons.  If the user clicked "Do Delete"
it sends them to introSaveMessageAdd and then to deleteBitmap, and then to
the introAddPage.

This way my actions a very modular.

You can also do a DECHAIN which will run through the actions like normal but
the last one is treated as a seperate request and gets a new form and
request object (good for going from one form to another and not having bean
issues).

It also does other things like you can defined a message to put into the
session at the end of the chain, etc...

Anyway.. I can see if I can release the code if you want.

----- Original Message -----
From: "julian green" <julian.green@jacobsrimell.com>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
Sent: Friday, March 07, 2003 11:04 AM
Subject: Re: How do you keep your session junk free?


> It would be neat if you could group a bunch of action definitions
> together and have the form bean persist while the group remianed active.
>
> Julian
>
> David Graham wrote:
> >
> >> Explain how some other approach handles it in any better way? Use of
> >> token to prevent duplicate submissions works for me. And what do you
> >> mean by a continuation-style programming?
> >>
> > The token approach is an easy solution.  One of the sites listed was a
> > Smalltalk web framework.  It's good to look at things in different ways
> > but you could probably count the number of Smalltalk web applications on
> > one hand :-).
> >
> > David
> >
> >
> > _________________________________________________________________
> > Help STOP SPAM with the new MSN 8 and get 2 months FREE*
> > http://join.msn.com/?page=features/junkmail
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>


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


Mime
View raw message