PDA

View Full Version : ExtDirect Java package names



tomim
12 Jun 2010, 9:52 AM
Hi all,

I have custom extdirect Java server side engine for maping java classes to extdirect but the problem is naming in ext direct json definition.
Is it possible to define ExtDirect name with full classpath name ?
For example if my Java class is net.security.LoginAction can I instead of using naming like in this example

var item = {"url":"/sec","type":"remoting","actions":{"LoginAction":[{"name":"login","len":2,
"formHandler":false},{"name":"isSession","len":-1,"formHandler":
false},{"name":"logout","len":-1,"formHandler":false},{"name":
"change","len":2,"formHandler":false}]}};

to use naming in this form

var item = {"url":"/sec","type":"remoting","actions":{"net.security.LoginAction":[{"name":"login","len":2,
"formHandler":false},{"name":"isSession","len":-1,"formHandler":
false},{"name":"logout","len":-1,"formHandler":false},{"name":
"change","len":2,"formHandler":false}]}};

This way it should work like standard JSON Java RPC creating full package/class path.
So my ExtDirect calll from javascript will be net.security.LoginAction() and not LoginAction().



Tom

tomim
12 Jun 2010, 10:05 AM
Oh my gosh!!! After 2hrs looking for how to do it I just found it after the first post :)
(Obvoiusly I did not read specification well)

If anyone asked the same qustion , it should be :))

var item = {namespace : "net.security" , "url":"/sec","type":"remoting","actions":{"LoginAction":[{"name":"login","len":2,
"formHandler":false},{"name":"isSession","len":-1,"formHandler":
false},{"name":"logout","len":-1,"formHandler":false},{"name":
"change","len":2,"formHandler":false}]}};