--- Dick Zetterberg <[EMAIL PROTECTED]> wrote: > Hi, > > I just had a look at the code and tested it. > Unfortunately it does not work if you close the > action tag as you thought > Rickard. > When the Action tag end is reached it calls the > dispatcher finalizeContext > method which creates a new ActionContext object and > sets it. The lookup > table from any previous context is then put into the > new context. > But if you do not have a previous context (like in > this model-1 example), it > is of course empty. > > Wouldn't it be nice if in a web environment the > stuff that is consistent > during the request, would remain in the > ActionContext? Perhaps it could be > solved by adding another lookup table in the > ActionContext for those > "long-lived" objects (request, response, > servletcontext, session...). In the > finalizeContext method that map would just be > transferred to the new > ActionContext created. > The "long-lived" lookup table would still be set > whenever an action is > dispatched from ServletDispatcher or from an Action > tag etc, so that no old > data would be lingering in the context. > Just a thought....
I also played around. I put all code which does work into actions ( and while doing this I discovered that you can count on ActionContext only inside doExecute() / execute() ) - i got terrible race conditions while trying to access action context out of getter methods of my action. When I moved the code to doExcetutze() those races dissappeared. As I can see from code, there are 2 kinds of session maps in ActionContext - vanilla HashMap while not in servlet environment, and SessionMap which is wrapper around real session. >From my point of view, it would be logical in servlet entvironment to use this session map ( and of course synchronize on it, for cases where there 2 requests paralel - like mine with frames ) Another question: If I specify action in jsp page, when exactly it's executed? I got following code in jsp ---%<---------------------- <decorator:usePage id="screen"/> <webwork:action name="'windowManager'" id="wm"/> <webwork:action name="'renderScreen'" id="render"> <webwork:param name="'page'" value="@screen"/> <webwork:param name="'URL'"><webwork:url/></webwork:param> <webwork:param name="'windowManager'" value="@wm/windowManager"/> <!-- foo bar --> </webwork:action> <webwork:if test="@render/refreshSidebar"> <SCRIPT language="JavaScript"> <!-- parent.navbar.location.href = "<%= request.getContextPath() + "/layout/sidebar.jsp"%>" ; //--> </SCRIPT> </webwork:if> <webwork:if test="@render/refreshToolbar"> <SCRIPT language="JavaScript"> <!-- parent.parent.toolbar.location.href = "<%= request.getContextPath() + "/layout/toolbar.jsp"%>" ; //--> </SCRIPT> </webwork:if> -----%<--------------------- >From console debug I can see: ---%<................ 13:07:42,900 DEBUG [ServletValueStack] findValue() for: query="'windowManager'" {[id="windowManager" type="0" values=""]} 13:07:42,902 DEBUG [ActionSupport] Action executing.. 13:07:42,902 DEBUG [WindowManagerAction] get session before synchronizing: {com.infodesire.webgui.beans.WindowManager=com.infodesire.webgui.beans.WindowManager@1939100} 13:07:42,902 DEBUG [WindowManagerAction] get session while synchronizing: {com.infodesire.webgui.beans.WindowManager=com.infodesire.webgui.beans.WindowManager@1939100} 13:07:42,902 DEBUG [ActionSupport] Action execution done 13:07:42,902 DEBUG [ActionSupport] Action executed in 0 ms 13:07:42,903 DEBUG [ServletValueStack] findValue() for: query="'renderScreen'" {[id="renderScreen" type="0" values=""]} 13:07:42,904 DEBUG [ServletValueStack] findValue() for: query="'page'" {[id="page" type="0" values=""]} 13:07:42,904 DEBUG [ServletValueStack] findValue() for: query="@screen" {[id="screen" type="6" values=""]} 13:07:42,904 DEBUG [RenderScreenAction] setting page: com.opensymphony.module.sitemesh.parser.FastPage@14e3372 13:07:42,904 DEBUG [ServletValueStack] findValue() for: query="'URL'" {[id="URL" type="0" values=""]} 13:07:42,904 DEBUG [RenderScreenAction] setting url: /porttest/application1/index.jsp 13:07:42,904 DEBUG [ServletValueStack] findValue() for: query="'windowManager'" {[id="windowManager" type="0" values=""]} 13:07:42,905 DEBUG [ServletValueStack] findValue() for: query="@wm/windowManager" {[id="wm" type="6" values=""]} {[id="windowManager" type="8" values=""]} 13:07:42,906 DEBUG [WindowManagerAction] returning window manager: com.infodesire.webgui.beans.WindowManager@1939100 13:07:42,906 DEBUG [RenderScreenAction] set window manager: com.infodesire.webgui.beans.WindowManager@1939100 13:07:42,906 DEBUG [ActionSupport] Action executing.. 13:07:42,906 DEBUG [WindowManager] returning active window: null 13:07:42,906 DEBUG [ActionSupport] Action execution done 13:07:42,907 DEBUG [ActionSupport] Action executed in 1 ms 13:07:42,907 DEBUG [ServletValueStack] findValue() for: query="@render/refreshSidebar" {[id="render" type="6" values=""]} {[id="refreshSidebar" type="8" values=""]} 13:07:42,907 DEBUG [RenderScreenAction] returning refreshSidebar: false 13:07:42,908 DEBUG [ServletValueStack] findValue() for: query="@render/refreshToolbar" {[id="render" type="6" values=""]} {[id="refreshToolbar" type="8" values=""]} 13:07:42,908 DEBUG [RenderScreenAction] returning refreshSidebar: false 13:07:42,908 DEBUG [ServletValueStack] findValue() for: query="'screen!faworites.action'" {[id="screen!faworites.action" type="0" values=""]} 13:07:42,908 DEBUG [ServletValueStack] findValue() for: query="'screen'" {[id="screen" type="0" values=""]} 13:07:42,908 DEBUG [ServletValueStack] findValue() for: query="@screen/request" {[id="screen" type="6" values=""]} {[id="request" type="8" values=""]} 13:07:42,909 DEBUG [ServletValueStack] findValue() for: query="'window!separate.action'" {[id="window!separate.action" type="0" values=""]} 13:07:42,910 DEBUG [ServletValueStack] findValue() for: query="'name'" {[id="name" type="0" values=""]} 13:07:42,910 DEBUG [ServletValueStack] findValue() for: query="@wm/activeWindow/name" {[id="wm" type="6" values=""]} {[id="activeWindow" type="8" values=""]} {[id="name" type="8" values=""]} 13:07:42,910 DEBUG [ServletValueStack] value for [@wm/activeWindow/name] is null. 13:07:42,910 DEBUG [ServletValueStack] findValue() for: query="'window!close.action'" {[id="window!close.action" type="0" values=""]} 13:07:42,910 DEBUG [ServletValueStack] findValue() for: query="'name'" {[id="name" type="0" values=""]} 13:07:42,910 DEBUG [ServletValueStack] findValue() for: query="@wm/activeWindow/name" {[id="wm" type="6" values=""]} {[id="activeWindow" type="8" values=""]} {[id="name" type="8" values=""]} 13:07:42,910 DEBUG [ServletValueStack] value for [@wm/activeWindow/name] is null. ---%<---------------- that windwManager is executing, but not renderScreen. Though values were set and get on render screen... regards, ===== Konstantin Priblouda ( ko5tik ) Freelance Software developer < http://www.pribluda.de > < play java games -> http://www.yook.de > < render charts online -> http://www.pribluda.de/povray/ > __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.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