Skip to content
ralscha edited this page Oct 2, 2012 · 20 revisions

ExtDirectSpring is a library that connects Ext JS (3.x,4.x) and Sencha Touch 2 JavaScript applications with Spring 3 MVC back ends. The library implements the Ext.Direct specification. It supports all the features of Ext.Direct, from simple remote calls to form posts with file upload.

To make a server method accessible it needs to be annotated with @ExtDirectMethod and it has to be a member of a Spring managed bean.

@Service
public class TestAction {

  @ExtDirectMethod
  public long multiply(long num) {
    return num * 8;
  }
}

and then call the method from JavaScript

testAction.multiply(2, function(result) {
  Ext.MessageBox.alert("Result", result);
});