On Jan 14, 2008, at 4:53 PM, rssh wrote:
On Mon, 14 Jan 2008 17:50:27 +0300, rssh wrote
Good day.
Sorry for stupid question.
$request.getHttpServletRequest().getSession().setAttribute("X", $request.get("X")) and then #set($X= $request.getHttpServletRequest().getSession().getAttribute("X"))
do the trick.
So, yes, XWiki can be good programming platform ;)
There are several ways you can do this: * pass the parameters in the URL * use the velocity context * use the session * use the application context * use request attributes if you do a server side redirect * use the xwiki context itself Note that the only reason your code didn't work is because you need programming rights to be allowed to set values in the xwiki context: public void put(String key, java.lang.Object value) { if (hasProgrammingRights()) { getXWikiContext().put(key, value); } } -Vincent
Yet one question - I can't find way to pass parameters from one screen to another. In JSP this is usually doing thought session- scope variables. Are exists some analog in XWiki ?
I.e. let I have page A and receive in one request with parameters. Than I want forward such request (with parameters) to page B.
I can't find the way to do this: if in A before redirect I write $context.put("X","Y"), than in B $context.get("X") return nothing.
May be I need care about passing some sessionId ?