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