Is it possible to call a java component from a JavaScriptExtension? like
this:
In javascript:
require(['jquery'], function ($) {
$('#ToJava').click(function(){
var returnValue = $services.mycomponent.mymethod( someNumber );
// use return value
});
});
In java:
public int mymethod(int num){
return num +1;
}
I know that I can do the ajax round trip and invoke the method through
velocity:
http://extensions.xwiki.org/xwiki/bin/view/Extension/AJAX+example
-- just wondering if there is a way to shortcut this process by avoiding
velocity and only working in js?
or is my logic flawed?
--
View this message in context:
http://xwiki.475771.n2.nabble.com/calling-a-java-component-from-JavaScriptE…
Sent from the XWiki- Users mailing list archive at
Nabble.com.