On 05/27/2013 11:15 AM, [email protected] wrote:
> Hi everybody,
> 
> I would like to send a javascript parameter with this jQuery method :
> 
> $.ajax({
> 
>         url: "myurl",
>         dataType: "json",
>         data: {"myparameter" : "value"},
>         beforeSend : function(xhr) {
>         xhr.setRequestHeader("Authorization", "Basic " + coded);
>         }
> 
>       })
> 
> Do you know how I could get the parameter "myparameter" back and use its
> value in a velocity script ? I don't know if it's possible or not.

Sure, $request [1] exposes the request, which extends ServletRequest
which does have these methods:

$request.getParameter('myparameter') -> get one value
$request.getParameterValues('myparameter') -> get a list with all the values

[1]
http://platform.xwiki.org/xwiki/bin/view/SRD/Navigation?api=request&xpage=embed

> Thanks in advance for your help.
> 
> Regards, Pierrick
> 


-- 
Sergiu Dumitriu
http://purl.org/net/sergiu
_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to