Erik Weber wrote:
Erik, another approach, that I though, not implemented yet, is instead of using a regular datastructure like a map, we could create a graph of objects, where each vertex would be an Object stored in the session, and edges would be links that ties each one of them.
Vinicius Carvalho wrote:
Freddy Villalba A. wrote:
Well guys, although on the same direction you are pointing to, I do believeI was reading this and Erik's idea seems fantastic. We are facing this dilema here, not the formbean one, but the too much objects in a session. When the project started, the programmers had no experience at all. and started to deliberatly use the session to store large data structures, today in a single navigation, of one user, the session size can easily gets to over 100k per user, (we may have some thousand of users at the same time, I don't want to imagine this scenario though).
though that the more framework-independent the solution is, the better. So,
my thought:
Why not have a XML descriptor where you can explicitly define your wizards?
In that way:
(1) No matter where your resources are, they'll get cleansed.
(2) You'll be able to reuse resources at free will on several wizards
(without having to replicate them).
(3) You won't have to set up any structure or hardcode anything in order to
determine what's to be cleansed an what not.
What do you think?
-----Mensaje original----- De: Erik Weber [mailto:[EMAIL PROTECTED] Enviado el: jueves, 07 de octubre de 2004 13:26 Para: Struts Users Mailing List Asunto: Re: cleaning session
Yeah, "similar naming convention" is the key to making it easier on yourself.
Also, as I tried to suggest once before (in a riddle -- "a single key can open many doors" -- ha ha ha grasshoppah), you can store references to many objects under a single attribute key (using structured/nested beans, maps, etc.). Delete the single attribute (perhaps when a user returns to a main view) and you delete the entire tree of references, freeing up all that memory with one statement and without having to write too much conditional code. I'm not sure if this strategy is feasible with Struts session-scoped forms though.
Erik
[EMAIL PROTECTED] wrote:
Hi, Erik and Freddz.
I like the idea of having a wizard whose data gets cleaned as soon as it's
scope is left.
How about this: Have all resources for one wizard in a URL subdirectory.
Have a similar naming convention for the resources the wizard leaves in the
session. If a http request comes for an url, the janitor filter could remove
all wizard's session resources that do not match the current request's
directory.
This way the janitor could be fairly generic.
Hiran
----------------------------------------- Hiran Chaudhuri SAG Systemhaus GmbH Elsenheimer Straße 11 80867 München Phone +49-89-54 74 21 34 Fax +49-89-54 74 21 99
-----Original Message----- From: Erik Weber [mailto:[EMAIL PROTECTED] Sent: Donnerstag, 7. Oktober 2004 11:55 To: Struts Users Mailing List Subject: Re: cleaning session
This is similar to what I usually implement. I have been gradually developing a "session manager" or perhaps a "session janitor" that watches/tracks workflow and cleans up stuff from memory (session) that isn't needed anymore. It could be a filter or a custom request processor in the world of Struts. Since I most often use my own controller Servlet I have my own place to put it, but basically, it gets invoked before any request handlers.
Erik
Freddy Villalba A. wrote:
Hi,
I have never implemented anything like this (with Struts),
but this is
the first thing I can think of...
Assuming your wizard is one-way (by this, I mean you have a linear graph - 1<->2<->3... -, no bifurcations and /or
intersections and / or
parallelism), you could "define" your "workflow" by
"tagging" the pages it is made of...
then, manage the wizard from a filter that is able to detect your getting into one and your leaving it. Once it detects
someone's left a
wizard, and knowing its components, it could have them
cleaned off the
corresponding Session.
I believe, however, that this approach wouldn't work if the graph is not linear.
I'll be glad to here your feedback (everybody).
HTH, Freddy.
-----Mensaje original----- De: Paul McCulloch [mailto:[EMAIL PROTECTED] Enviado el: jueves, 07 de octubre de 2004 10:27 Para: 'Struts Users Mailing List' Asunto: RE: cleaning session
That isn't the purpose of the (confusingly named) reset
method. Reset
is there to, typically, deal with the html forms submit
checkbox fields
(they don't submit anything if they are null).
Paul
-----Original Message----- From: Leandro Melo [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 06, 2004 5:43 PM To: Struts Users Mailing List Subject: Re: cleaning session
If you have your action in HttpSession, why don`t you just
call reset
whenever a user clicks on the button supposed to start this wizard?
--- struts lover <[EMAIL PROTECTED]> escreveu:
Hello everyone, I am facing this problem of session. I have my action form in session(a wizard like thing). Now if the user starts filling in values and clicks on the NEXT button, to go on to the next screen and then instead of completing the process of application,
clicks on
some other link. Again he wants to start with the application process, the form get pre-populated with the previous values, as the form in still in session. I want a clean form. How to overcome this problem??? Any ideas??? Thanks.
_______________________________ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.com
------------------------------------------------------------
---------
To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
------------------------------------------------------------
---------
To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
*************************************************************
*********
Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this
message.
If you are not the addressee indicated in this message (or
responsible
for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should
destroy this
message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information
expressed in
this message are not given or endorsed by my Company or
employer unless
otherwise indicated by an authorised representative
independent of this message.
WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot
guarantee
that attachments do not contain computer virus code. You
are therefore
strongly advised to undertake anti virus checks prior to
accessing the
attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any
attachment and
undertakes no liability for loss or damage howsoever caused. *************************************************************
*********
---------------------------------------------------------------------
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]
--------------------------------------------------------------------- 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]
Now we need to create this session janitor, but one thing that's always comes in my mind is, how to define boundaries for each scope? Erik could u post some part of your code to share within us?
Thanks
The idea I had, which I have not implemented, was something along these lines:
A single session attribute key for "vendor forms" for example. The value could be a Map for example. Then the keys in the Map could follow some naming convention -- "area1.form1", "area1".form2", "area2.form1", "area2.form2", etc. Then you have a guy sitting at the request processor level (someone who sees every request) who keeps track of the workflow for the session. Based on what he thinks is right, he can grab the collection of "vendor forms" from the user's session and delete all the "area1" entries, for example. Similarly, even all the vendor-related data could be eliminated with a single removal of the "vendor forms" session attribute. Seemingly this workflow-to-forms/session data mapping could be configured via XML. But since Struts stores session-scoped forms how it wants, I'm not sure how to tie the idea to Struts, but maybe the Map doesn't hold references to the forms themselves, but simply holds the names of (keys to) all the forms. Then a cleanup object could consult the workflow configuration, use the Map to determine the names of all the session attributes that need to be cleaned up, and pass all those names to a bulk deletion method.
Anyway, I haven't taken this idea far enough yet. But I am interested in it.
Erik
--------------------------------------------------------------------- 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]
For example, in my app, sometimes if I have A and B stored, in certain cases C is needed also, that would be Accomplished by linnking A and B to C.
Subgraphs of the graph could represent on entire sector, for example the vendor area. When the user changes to another area, the session-janitor (I really liked this name) would remove those subgraphs, all but the vertex that might be linked to a certain vertex of our context. I need to check my Graphs book again to see another properties and type of graphs that might be used, we may have also certain objects that may never be collectted by our janitor. Anyway, this may be an idea, we may transform into a fully functional class. Jung is a great graph framework to start with. The graph itself maybe declared as a XML file.
What you guys think?
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]