Call Java WebScripts From JavaScript

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
riadhazzouz
Active Member

Call Java WebScripts From JavaScript

I created a java backed webscript that return an object which I created :

Map<String, Object> model = new HashMap<String, Object>();
model.put("value", n); // n object has diffrent attributes.

How can I call this object from javascript to use the attributes ? 

4 Replies
brahmaiah926
Member II

Re: Call Java WebScripts From JavaScript

You can call using webscript url by Alfresco.util.Ajax.request

according to the type of webscript.

riadhazzouz
Active Member

Re: Call Java WebScripts From JavaScript

Are there any examples I can follow ?
Thanks.

brahmaiah926
Member II

Re: Call Java WebScripts From JavaScript

Alfresco.util.Ajax.request(
{
url: Alfresco.constants.URL_SERVICECONTEXT + "ur/of/web/service",
dataObj:
{
htmlid: this.id
},
successCallback:
{
fn: this.onTemplateLoaded,
scope: this
},
execScripts: true,
failureMessage: "Could not load create site template"
});

riadhazzouz
Active Member

Re: Call Java WebScripts From JavaScript

I am supposed to put the url in the description file and that's it ?
and what is the variable that i can use to get the data from ?
Thanks