Integrate Flex With Spring Framework

6,166 views
5,999 views

Published on

Published in: Technology, Education
2 Comments
3 Likes
Statistics
Notes
No Downloads
Views
Total views
6,166
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
277
Comments
2
Likes
3
Embeds 0
No embeds

No notes for slide

Integrate Flex With Spring Framework

  1. 1. Integrate Flex with Spring Framework<br />Albert Guo<br />junyuo@gmail.com<br />
  2. 2. Pre-requisite<br />Download BlazeDS<br />Create a Dynamic Web Project<br />Integrate Flex with Spring Framework<br />Create a Flex Project<br />Reference <br />2<br />Agenda<br />
  3. 3. Eclipse3.4(J2EE Version):<br />http://www.eclipse.org/downloads/<br />Flex Builder3<br />http://www.adobe.com/cfusion/entitlement/index.cfm?e=flex3email&sdid=EOZPI<br />Tomcat 6<br />http://tomcat.apache.org/<br />BlazeDS<br />http://opensource.adobe.com/wiki/display/blazeds/BlazeDS/<br />Spring Framework<br />http://www.springsource.org/download<br />Spring BlazeDS Integration<br />http://www.springsource.org/spring-flex<br />ANTLR3.0<br />http://www.antlr.org/download.html<br />AOPAlliance<br />http://mirrors.ibiblio.org/pub/mirrors/maven2/aopalliance/aopalliance/1.0/<br />Jackson<br />http://snapshots.repository.codehaus.org/org/codehaus/jackson/jackson-core-lgpl/1.1.0/<br />http://snapshots.repository.codehaus.org/org/codehaus/jackson/jackson-mapper-lgpl/1.1.0-SNAPSHOT/<br />Pre-requisite<br />3<br />
  4. 4. Download BlazeDS<br />
  5. 5. download BlazeDS from http://opensource.adobe.com/wiki/display/blazeds/BlazeDS/<br />unzip file and extract BlazeDS.war<br />Download BlazeDS<br />5<br />
  6. 6. 6<br />BlazeDS role<br />
  7. 7. 7<br />The Architecture of a BlazeDS Server<br />
  8. 8. Create a Dynamic Web Project<br />
  9. 9. Create a Dynamic Web Project<br />9<br />
  10. 10. Create a Dynamic Web Project – cont.<br />Assign project name, <br />called flex-test-server<br />Click Next<br />10<br />
  11. 11. Create a Dynamic Web Project – cont.<br />Assign context root, called “flex-test”<br />Click Finish<br />11<br />
  12. 12. Create a Dynamic Web Project – cont.<br />You can see this project structure <br />as you finished the project creation process<br />12<br />
  13. 13. Create a Dynamic Web Project – cont.<br />Import configuration files and <br />jar files from BlazeDS.war<br />13<br />
  14. 14. Create a Dynamic Web Project – cont.<br />Assign the directory which extract <br />from blazeds.war<br />Select the two directories<br />Click Finish<br />14<br />
  15. 15. Create a Dynamic Web Project – cont.<br />Click “Yes To All”<br />15<br />
  16. 16. Create a Dynamic Web Project – cont.<br />Set defualt channel in services-config.xml<br />Configureendponturl in services-config.xml<br />16<br />
  17. 17. Create a Dynamic Web Project – cont.<br />Deploy and startup Tomcat server<br />Connect to http://localhost:8080/flex-test/messagebroker/amf,<br /> you will see a blank page if correct <br />17<br />
  18. 18. Integrate Flex with Spring Framework<br />
  19. 19. Integrate Flex with Spring Framework<br />Create a spring folder which <br />is under WEB-INF<br />19<br />
  20. 20. Integrate Flex with Spring Framework – cont.<br />Create application-config.xml in <br />/WEB-INF/spring<br />20<br />
  21. 21. Integrate Flex with Spring Framework – cont.<br />Click HelloFlex class in <br />exmaple package<br />Click FInsih<br />21<br />
  22. 22. Integrate Flex with Spring Framework – cont.<br />Define a simple business method to say hello<br />Utizile annotation to define service name and remoting destination channels<br />Use @RemotingInculde or @RemotingExclude to define the method can be access or not<br /><ul><li>You don’t need to define anything in remoting-config.xml</li></ul>22<br />
  23. 23. Integrate Flex with Spring Framework – cont.<br />DefineHelloFlex bean into application-config.xml<br />Define message borker into application-config.xml<br />23<br />
  24. 24. Integrate Flex with Spring Framework – cont.<br />Define spring DispatherServlet into web.xml<br />Defineservet mapping into web.xml<br />24<br />
  25. 25. Integrate Flex with Spring Framework – cont.<br />Deploy and startup Tomcat server<br />Connect to http://localhost:8080/flex-test/spring/messagebroker/amf,<br /> you will see a blank page if correct<br />25<br />
  26. 26. Create a Flex Project<br />
  27. 27. Create a Flex Project<br />Define a Flex Project name, <br />which called “flex-test-client”<br />Click Next<br />27<br />
  28. 28. Create a Flex Project – cont.<br />Define root folder to flex-test-server/WebContent<br />Define root url<br />Define context root<br />Click Validate Configuration<br />Click Next<br />28<br />
  29. 29. Create a Flex Project – cont.<br />Click Finish<br />29<br />
  30. 30. Create a Flex Project – cont.<br />30<br />
  31. 31. Create a Flex Project – cont.<br />31<br />
  32. 32. Create a Flex Project – cont.<br />Add one more method in <br />HelloFlex class<br />32<br />
  33. 33. Create a Flex Project – cont.<br />Add one more button in mxml file<br />33<br />
  34. 34. Create a Flex Project – cont.<br />34<br />
  35. 35. Create a Flex Project – cont.<br />Create a calculation service to provide add service<br />35<br />
  36. 36. Create a Flex Project – cont.<br />Register service bean into application-config.xml<br />36<br />
  37. 37. Create a Flex Project – cont.<br />37<br />
  38. 38. Create a Flex Project – cont.<br />38<br />
  39. 39. An Introduction to Spring BlazeDS Integration<br />http://ria.dzone.com/articles/introduction-spring-blazeds?page=0,0<br />Flex Spring整合<br />http://www.javaeye.com/topic/392836<br />Spring BlazeDS Integration Reference Guide <br />http://static.springsource.org/spring-flex/docs/1.0.x/reference/htmlsingle/spring-flex-reference.html<br />3.4. Exporting Beans for Remoting with @RemotingDestination<br />http://static.springsource.org/spring-flex/docs/1.0.x/reference/html/ch03s04.html<br />39<br />Reference<br />

×