[xwiki-dev] A way to get a cookie value with velocity syntax ?
Hello everybody, Is there a way to get a cookie value with a function of the velocity syntax? I created a cookie with the javascript "createCookie()" function (in the file skins.js) and I would like to get it value in a velocity script in order to insert it in a sql query. Because I need to get the cookie value before the velocity parsing. For example in my wiki page : #set($sql = " where doc.fullName = '$a_function_which_read_a_cookie_value(name_of_the_cookie)' ") Regards, Mathieu --------------------------------------------------- Mathieu Emptoz CEA Cadarache DRFC/STEP XWiki's EFDA Remote Participation Administrator ---------------------------------------------------
$xwiki.getUserPreferenceFromCookie("my_cookie") Also check $xwiki.getUserPreference("my_cookie", true) On 2/19/07, EMPTOZ Mathieu 310507 <[email protected]> wrote:
Hello everybody,
Is there a way to get a cookie value with a function of the velocity syntax? I created a cookie with the javascript "createCookie()" function (in the file skins.js) and I would like to get it value in a velocity script in order to insert it in a sql query. Because I need to get the cookie value before the velocity parsing.
For example in my wiki page :
#set($sql = " where doc.fullName = '$ a_function_which_read_a_cookie_value(name_of_the_cookie)' ")
Hi, You need to go through the $request and/or $response APIs which are the HttpServletRequest and HttpServletResponse apis for which you can find javadocs on the internet. Ludovic EMPTOZ Mathieu 310507 a écrit :
Hello everybody,
Is there a way to get a cookie value with a function of the velocity syntax? I created a cookie with the javascript “createCookie()” function (in the file skins.js) and I would like to get it value in a velocity script in order to insert it in a sql query. Because I need to get the cookie value before the velocity parsing.
For example in my wiki page :
#set($sql = " where doc.fullName = '$a_function_which_read_a_cookie_value(name_of_the_cookie)' ")
Regards, Mathieu
***---------------------------------------------------*
*Mathieu Emptoz*
*CEA Cadarache DRFC/STEP*
*XWiki's EFDA Remote Participation Administrator*
*---------------------------------------------------*
------------------------------------------------------------------------
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
-- Ludovic Dubost Blog: http://www.ludovic.org/blog/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost AIM: nvludo Yahoo: ludovic
participants (3)
-
EMPTOZ Mathieu 310507 -
Ludovic Dubost -
Sergiu Dumitriu