1

我试图让ExtDirectSpring工作,但无法弄清楚直接路由器的 URL 应该是什么。

我的控制器:

@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"});
  }
}

在我的 JSP 中,我添加了一个像这样的提供者:

    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
                               });

...并使用以下商店填充网格:

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

加载页面,发送到http://localhost:8080/fkr/app/controller/extjs/remoting/router的请求,但不发送到我的 loadAllMyStuff- 函数。我的猜测是直接路由器的 URL 是错误的。

路由器的正确 URL 是什么?

编辑:我刚刚发现 RouterController 中的方法路由器需要参数extActionextMethod 但是使用给定的代码发送参数action方法。这似乎很奇怪...

4

0 回答 0