cancel
Showing results for 
Search instead for 
Did you mean: 

Making a HTTP GET in Javascript (Rhino in Alfresco)

flyer
Champ in-the-making
Champ in-the-making
Hi all,

I would like to perform a HTTP GET in a javascipt (running by Alfresco who is using rhino).

I've tried something like:
importPackage(Packages.org.apache.commons.httpclient.HttpClient);
or
var client = new java.org.apache.commons.httpclient.HttpClient();

but it seems like importPackage or imporClass or not accessible and HttpClient also Smiley Sad.

Any Idea?
Florent,
1 REPLY 1

arielb
Champ in-the-making
Champ in-the-making
i'm not quite sure how the classpath for rhino is set up.  what context are you running this script under?

one thing you might try is

var client = java.lang.Class.forName("org.apache.commons.httpclient.HttpClient").newInstance();