Konstantin Priblouda wrote:
I need a application-global object.Is there webwork example for such factory actions?What are you using the factory for? Sounds like the dispatcher to me.
Original version was: ---%<---------
public static getFoo(HttpSession bar) {
Foo foo = bar.getValue(FOO_KEY);
if(foo == null) {
foo = new Foo();
bar.put(FOO_KEY,foo);
}
return foo;
}
---%<-------------
Hm.. this is not application-global. It is session-specific.
First of all: do you want it to be application-wide or session-wide?Then i was in need to perform the same from action - so I modified this method to luse Map instead of session and added another static method which just feeds first one with ActionContext.getSession() Shall I use [say ] GenerixcDispatcher to initialize ActionContext ?
Regardless, the initialization should probably be done using a ServiceContextListener.
/Rickard
--
Rickard Öberg
[EMAIL PROTECTED]
Senselogic
Got blog? I do. http://dreambean.com
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork