POST Webscript

Showing results for 
Search instead for 
Did you mean: 
Active Member

POST Webscript

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");


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

return model;
Descriptor :
<shortname>Change status</shortname>
<description>Change status</description>
<format default="json">extension</format>
<authentication runas="admin">guest</authentication>

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

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

2 Replies
Established Member II

Re: POST Webscript

Is your controller in java executed?

Are you sure that the id of your backed web script bean match the package, name an HTTP Method of the webscript definition?

To ensure that you are configured correctly the Java Backed Web Script you can access the info page of your web script in the Alfresco Webscript Home and check that the property calledl implementation is pointing to your class.

Active Member

Re: POST Webscript

The problem was in the descriptor, in the url tag
It needs to be like this <url>/pfe/status?id={id?}&amp;username={username?}</url> with the question mark.