Original: Flex3 and Java blazeds Getting Started tutorial and its configuration detailed
Source code: Http://www.zuidaima.com/share/1789445387160576.htm
Download and introduction of BlazeDS:
Http://opensource.adobe.com/wiki/display/blazeds/Release+Builds (has expired)
New download path: http://sourceforge.net/adobe/wiki/Projects/or http://www.pc6.com/softview/SoftView_83105.html
There is a download for Tomcat
Http://flexorg.wip3.adobe.com/blazeds/3.0.x/milestone/3978/blazeds-bin-3.2.0.3978.zip
No Tomcat downloads.
Http://flexorg.wip3.adobe.com/blazeds/3.0.x/milestone/3978/blazeds-turnkey-3.2.0.3978.zip
After downloading, deploy the Blazeds.war to Tomcat.
Installation of the Flex Builder plugin is no longer described
Development work for MyEclipse:
1. Create a Flex Project
Configure as shown in the diagram
2. Next step:
Specify Blazeds.war that have already been downloaded
3. Next step.
Configure URLs
4. When finished, right-click to configure the project properties:
Note that the context of the modification, or run the program will be reported 404.
5. Create a new test class:
Package Com;public class helloworld{public string Say (String username) { System.out.println ("Hello"); Return "Hello!" + username; } public string Login (string username,string password) { System.out.println ("login"); if (username.equals ("admin") && password.equals ("admin") { return "success"; } else { return "failure";}} }
6. Configure the Remoting-config.xml file under Web-inf/flex:
<?xml version= "1.0" encoding= "UTF-8"? ><service id= "Remoting-service" class= " Flex.messaging.services.RemotingService "> <adapters> <adapter-definition id=" Java-object " class= "Flex.messaging.services.remoting.adapters.JavaAdapter" default= "true"/> </adapters> <default-channels> <channel ref= "My-amf"/> </default-channels> <!--target Java class-- > <destination id= "HelloWorld" > <properties> <source>com. helloworld</source> </properties> </destination> </service>
7. Write the Mxml file:
<?xml version= "1.0" encoding= "Utf-8"? ><mx:application xmlns:mx= "Http://www.adobe.com/2006/mxml" layout= " Absolute "><mx:Script> <! [cdata[import mx.rpc.events.ResultEvent; Import Mx.controls.Alert; Hello event Private Function Helloclick (): void {This.hello.say (this.username.text); }//Logon event Private Function Loginclick (): void {This.login.login (this.username.text , This.password.text); }//Handling Hello Event return value private Function Resulthandler (e:resultevent): void {alert.show (e.result . toString ()); }//Handle login event return value private Function Resultloginhandler (e:resultevent): void {alert.show (e.resul T as String); }]]></mx:script> <!--remote object calls--><mx:remoteobject id= "Hello" destination= "HelloWorld "Result=" Resulthandler (event) "/> <mx:remoteobject id=" Login "destination="HelloWorld "result=" Resultloginhandler (event) "/> <mx:textinput id=" username "x=" 187 "y=" for "width=" 119 "/ > <mx:label x= "123" y= "101" text= "username:"/> <mx:label x= "123" y= "141" text= "Password:"/> <mx : TextInput id= "password" x= "187" y= "139" width= "119"/> <mx:button x= "241" y= "184" label= "login" click= "Login Click () "/> <mx:button x=" 123 "y=" 184 "label=" HelloWorld "click=" Helloclick () "/> </mx:Application>
7. Locate Bin-debug under secondblaze.html Right-click on the run server.
Original: http://www.blogjava.net/supercrsky/archive/2009/04/23/267112.html
Blazeds_ Baidu Encyclopedia
By most code official editor at 2014-4-21 14:12:52
Flex3 and Java blazeds Getting Started tutorial and its configuration detailed