Hi
This is in contnuation to my earlier mail.
I have modified the "doBuildBeforeAction( data )" in
WebMacroSitePage class as follows :
protected void doBuildBeforeAction(RunData data) throws Exception
{
// this is original
/*
WebContext wc_data = TurbineWebMacro.getContext(data);
data.getTemplateInfo().setTemplateContext
(WebMacroService.WEBMACRO_CONTEXT, wc_data);
*/
// this is by venkat
// Attempt to get it from the session first. If it
// doesn't exist, create it and then stuff it into the
// session.
WebContext wc_data = (WebContext) data.getTemplateInfo
().getTemplateContext(WebMacroService.WEBMACRO_CONTEXT);
if (wc_data == null)
{
wc_data = TurbineWebMacro.getContext(data);
}
data.getTemplateInfo().setTemplateContext
(WebMacroService.WEBMACRO_CONTEXT, wc_data);
}
This is returning me the same context object in which I had put
data in my action module to my screen module.
The result in my log file is :
Default action :
----------------
wc_data is null. creating a new one
WebMacroSiteScreen : context :
org.webmacro.servlet.WebContext@c6ded868
Screen - Login : context :
org.webmacro.servlet.WebContext@c6ded868
WebMacroSiteScreen : context :
org.webmacro.servlet.WebContext@c6ded868
When Login fails :
------------------
WebMacroSiteAction : context :
org.webmacro.servlet.WebContext@cc5ed866
Action - LoginUser : context :
org.webmacro.servlet.WebContext@cc5ed866 <----
WebMacroSiteAction : context :
org.webmacro.servlet.WebContext@cc5ed866
WebMacroSiteScreen : context :
org.webmacro.servlet.WebContext@cc5ed866
Screen - Login : context :
org.webmacro.servlet.WebContext@cc5ed866 <----
WebMacroSiteScreen : context :
org.webmacro.servlet.WebContext@cc5ed866
Will this change effect me elsewhere ? Is this really a bug or
any other change is effecting me ?
Thanks for all of you. Could anyone confirm me the change ?
Venkat
Sorry to state the obvious, but just so it doesn't get missed.
You are
obviously creating a new context in your Screen module. There
is a helper
method in many of the WebMacro modules that is used to get the
context. If one
does not exist this helper method uses the service to create
one. It then
places it into an object which is stored in RunData
(TemplateInfo). So that the
next time (in another module, most likely) the helper method is
invoked it will
return the one in TemplateInfo in RunData.
So all I can say is track down why this process is breaking down
for you.
BTW, in the velocity service I added a method like this to the
service, so that
it did not have to be repeated in every module.
John McNally
[EMAIL PROTECTED] wrote:
>
> Hi Jon,
>
> I do not put any data into turbine RunData object. What I do
> is this :
>
> context.put("key", key);
> context.put("value", value);
>
> I call this in my Screen module (for debugging) as :
>
> context.get("key");
>
> and also in my template as :
>
> $key
>
> I get 'null' in both the places.
>
> Thanks
>
> Venkat
>
> on 10/20/2000 6:59 AM, "[EMAIL PROTECTED]"
> <[EMAIL PROTECTED]>
> wrote:
>
> > Hi,
> >
> > I have been using developer's daily snapshot of Turbine dated
> 20000905 and am
> > happy with it so far.
> >
> > For the time being, I have the following problem :
> >
> > I have observed that the data I stuff in context object in my
> Action module is
> > not being passed on to my Screen module.
> >
> > I use complete Webmacro site model.
> >
> > Has anyone has any idea ?
> >
> > Thanks
> >
> > Venkat
>
> Nope, no idea. Works fine here. What "data" are you "stuff"ing
> into it? In
> most cases, with the WM model, you would put something into the
> context, not
> into the RunData object.
>
> -jon
>
> --
> http://scarab.tigris.org/ | http://noodle.tigris.org/
> http://java.apache.org/ | http://java.apache.org/turbine/
> http://www.working-dogs.com/ |
> http://jakarta.apache.org/velocity/
> http://www.collab.net/ | http://www.sourcexchange.com/
>
> ------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Search: <http://www.mail-archive.com/turbine%40list.working-
> dogs.com/>
> Problems?: [EMAIL PROTECTED]
>
> ------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Search: <http://www.mail-archive.com/turbine%40list.working-
dogs.com/>
> Problems?: [EMAIL PROTECTED]
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-
dogs.com/>
Problems?: [EMAIL PROTECTED]
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]