ExtDirectSpring Router URL?

694 Views Asked by At

I'm trying to get ExtDirectSpring to work but can't figure out what the URL to the Direct Router shall be.

My controller:

@Controller
@RequestMapping(value = "/sonstiges/extdirect")
@Transactional
public class ExtDirectController {

  @RequestMapping(value = "")
  public String start() throws Exception {
    return "/sonstiges/extdirect";
  }

  @ExtDirectMethod(value = ExtDirectMethodType.STORE_READ)
  public List<String> loadAllMyStuff() {
    return Arrays.asList(new String[] {"one", "two"});
  }
}

In my JSP I add a provider like this:

    Ext.direct.Manager.addProvider({
                                 "type":"remoting",       // create a Ext.direct.RemotingProvider
                                 "url":"/fkr/app/controller/extjs/remoting/router", // url to connect to the Ext.Direct server-side router.    
                                 "actions":{              // each property within the actions object represents a Class
                                   "ExtDirectController":[
                                     // array of methods within each server side Class
                                     {
                                       "name":"loadAllMyStuff", // name of method
                                       "len":0
                                     },
                                     {
                                       "name":"myTestFunction", // name of method
                                       "len":0
                                     }
                                   ]
                                 },
                                 "namespace":"FKR"// namespace to create the Remoting Provider in
                               });

... and use the following store to populate a grid:

store: {
        model: 'Company',
        remoteSort: true,
        autoLoad: true,
        sorters: [
        {
            property: 'turnover',
            direction: 'DESC'
        }],
        proxy: {
            type: 'direct',
            directFn: FKR.ExtDirectController.loadAllMyStuff
        }
  }

Loading the page, a request to http://localhost:8080/fkr/app/controller/extjs/remoting/router is send, but not to my loadAllMyStuff- function. My guess is that the URL to the direct router is wrong.

What is the correct URL to the router?

EDIT: I just figured out that the method router in RouterController expects the parameters extAction and extMethod, but with the given code the parameters action and method are sent. That seems to be odd ...

0

There are 0 best solutions below