Re: [xwiki-users] Passing parameters in URI
On Thu, May 10, 2012 at 9:48 AM, Moritz Hesse (EA GmbH) <[email protected]> wrote:
Hello,
how is it possible (I presume it is) to access parameters in a URI? The xwiki API describes methods to encode and decode URIs (namely encodeURI and decodeURI). I suppose I can access it via the Request object (XWikiRequest; http://maven.xwiki.org/site/xwiki-core-parent/xwiki-core/apidocs/com/xpn/xwi ki/web/XWikiRequest.html), but got no clue how.
E.g. I would like to pass a boolean param by calling the URI http://<mydomain>/xwiki/bin/view/Main/WebHome?bool=true and access it in velocity code.
Anyone has an idea how to proceed or a link to an example?
You can access the http://maven.xwiki.org/site/xwiki-core-parent/xwiki-core/apidocs/com/xpn/xwi... object using $request in Velocity (or "request" mapping in general in all other languages).
Thx and bests, Moritz
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Thomas Mortagne
Hi,
You can access the
http://maven.xwiki.org/site/xwiki-core-parent/xwiki-core/apidocs/com/xpn/xwi ki/web/XWikiServletRequest.html
object using $request in Velocity (or "request" mapping in general in all other languages).
I don't get any wanted results, everything just looks like this: com.xpn.xwiki.web.XWikiServletRequest@76536fbc, that java.util.Collections$2@2953fef or this one org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter$Save dRequestWrapper@1498653c. Is there any helpful method (like var_dump() in PHP) that enables me to debug all existing values of an object? Bests, Moritz
What is an appropriate way to structure multidimensional arrays in velocity? Let's say I want to have a main topic with two subtopics with three elements each: 1 maintopic 1.1 subtopic1 1.1.1 one 1.1.2 two 1.1.3 three 1.2 subtopic2 1.2.1 one 1.2.2 two 1.2.3 three My approach would be: {{velocity}} #set( $maintopic = ["subtopic1", "subtopic2"] ) #set( $maintopic.subtopic1 = ["one", "two", "three"] ) #set( $maintopic.subtopic2 = ["one", "two", "three"] ) {{/velocity}} But I cannot access the one-two-threes in each subtopic. What am I doing wrong? Thanks and best regards, Moritz
participants (2)
-
Moritz Hesse (EA GmbH) -
Thomas Mortagne