And BlazeDS is the only function that I only know how to retrieve the data from java.Next I will introduce how We need to add to the j2ee server to enable the BlazeDS work.First we should download BlazeDS archive,the link is here ,when we have downloaded the file ,please upzip it,we will get two file,one is a .html file,the other is a .war.We all knew that a .war is compression file so we can upzip the war file,then we can see the web application structure.So the need is the three things(1.web.xml2.flex folder 3.lib folder).
We can see a fragement in the web.xml
The BlazeDS must reading the services-config.xml
So we go to the services-config.xml then we can see the below fragement
Because we use RemoteObject component,so we look the remoting-config.xml
Then we should add the tag destination after default-channels
In the destination tag,we must define id ,and name the id attribute,then put the child node properties and its child node source.In the source node,we will put our java class with its package name.
Below is the java method
Below is its method named sendMail,then we can use RemoteObject to call sendMail method of java side.
and use the RemoteObject(flex) instance to call java method(sendMail)
So our RemoteObject(flex) can call the java method successfully.
沒有留言:
張貼留言