AnsweredAssumed Answered

POST Webscript

Question asked by riadhazzouz on Apr 8, 2019
Latest reply on Apr 9, 2019 by riadhazzouz

I wrote  a post webscript :

 

JAVA Controller :

protected Map<String, Object> executeImpl(WebScriptRequest req,
Status status) {

String id = (String) req.getParameter("id");
String username = (String) req.getParameter("username");
System.out.println(username);
System.out.println(id);

 

//OTHER STUFF

 

model.put("id", id);
model.put("username", username);

return model;
}
Descriptor :
<webscript>
<shortname>Change status</shortname>
<description>Change status</description>
<url>/pfe/status?id={id}&amp;username={username}</url>
<format default="json">extension</format>
<authentication runas="admin">guest</authentication>
<transaction>required</transaction>
</webscript>

 

Template
{"ChangeStatus" :
{
"id" : "${id}",
"username" : "${username}"
}
}

And I'm always getting username = null and id = null ?

Outcomes