cancel
Showing results for 
Search instead for 
Did you mean: 

how to call another webscript inside webscript in java controller if both are in same repository

chaituu
Champ in-the-making
Champ in-the-making
how to call another webscript inside one webscript in java controller if both are in same repository.

//hellowebscript
public void execute(WebScriptRequest request, WebScriptResponse response)
{

//need to call another webscript
}
1 REPLY 1

steven_okennedy
Star Contributor
Star Contributor
Hi,

I remember asking a similar question a number of year ago.  So the webscript framework wasn't designed to allow calling webscripts from within webscripts easily, but the good news with Java-backed ones, because it's Java you can just make a HTTP call to call the webscript you want. It won't be efficient - you'll have to make a call out and block until you get the response back (HTTP is asynchronous) and you'll have to parse the response you get back before you can use the info you want.

If you really want to do it though, you can just make the http call like you would in any Java application, e.g. Apache HTTPClient etc.

Regards

Steven