Hi, I am having similar trouble. Using page pre-controller, I am calling the following method:
public ForwardAction setPageScopeVar(RequestContext context){ try{ String mboxValue = context.getParameterString("mbox"); if(mboxValue != null){ context.getPageScopeData().put("mbox", mboxValue); } } catch(Exception e){ System.out.println(e); e.printStackTrace(); } return null;}
null
Ghoti: Thanks for your reply, in this case, my goal is to add to PageScope map using context.getPageScopeData().put("mbox", mboxValue);
Be that as it may - the code you posted always returns null regardless of whether the above code succeeds or not - and as the method is defined as returning an object of type ForwardAction, presumably somewhere you would need to create such an object and return it (on success).Like I said, I don't know anything about LiveSite development work - I'm just saying that the code you posted appears to be definitively wrong with regard to distinguishing between success and failure.
Is $PAGE_SCOPE[mbox] available during xsl test?In the past, testing with page token values always failed since value was null (page tokens evaluated after xsl). Nevertheless, I'll give it a try.
idol.properties
PropertyConfiguration
developer.spar
/** * A lightweight utility class that returns configuration properties that * ultimately reside in a properties file. The properties file can be read at * design-time or run-time, and gets cached at runtime using an * application-scoped cache. ...
/** * A lightweight utility class that returns configuration properties that * ultimately reside in a properties file. The properties file can be read at * design-time or run-time, and gets cached at runtime using an * application-scoped cache.
Since you are offline generating the actual page into HTML, then true the session does not exist and page scope will only let you place items into it so they can be read during rendering.Here is how to get the token to work:1. In your controller (site/page/component) or external do: context.getPageScope().put("mbox", mBoxValue);2. In your XSL/skin you access it using: $PAGE_SCOPE[mbox]
Components are all executed and each updates their own local map first. Then, the page is redered and all component maps are combined and used in the output. This token is accessed using external code RequestContext.getPageScopeData() as a Map type where you can add name or value pairs via prefix or external code and extract it to the page.