您的位置:首页 > 产品设计 > UI/UE

Flex + Blazeds "HelloWorld" in Flash builder 4.5

2011-09-21 01:58 393 查看
for detail, refer to http://www.adobe.com/devnet/flex/articles/flashbuilder_blazeds.html
前提条件:安装tomcat

1. 在<tomcat_home>/webapps目录下创建一个目录 (e.g. "blazeds" folder)

2. 从http://opensource.adobe.com/wiki/display/blazeds/Release+Builds下载blazeds binary zip file,然后解压,得到war file,再解

压到step 2创建的目录

3. 修改WEB-INF/web.xml

1) 取消下列代码的注释

<servlet>

<servlet-name>RDSDispatchServlet</servlet-name>

<display-name>RDSDispatchServlet</display-name>

<servlet-class>flex.rds.server.servlet.FrontEndServlet</servlet-class>

<init-param>

<param-name>useAppserverSecurity</param-name>

<param-value>false</param-value>

</init-param>

<load-on-startup>10</load-on-startup>

</servlet>

<servlet-mapping id="RDS_DISPATCH_MAPPING">

<servlet-name>RDSDispatchServlet</servlet-name>

<url-pattern>/CFIDE/main/ide.cfm</url-pattern>

</servlet-mapping>

2) 把下列部分

<init-param>

<param-name>useAppserverSecurity</param-name>

<param-value>true</param-value>

</init-param>

修改为

<init-param>

<param-name>useAppserverSecurity</param-name>

<param-value>false</param-value>

</init-param>

4. 把下列代码compile之后放到WEB-INF/classes

package test;

public class SimpleCustomerService {

public String helloWorld(){

return "Hello World";

}

}

5. 在WEB-INF/flex/remoting-config.xml的<service>里添加下列代码

<destination id="SimpleCustomerServiceDestination">

<properties>

<source>test.SimpleCustomerService</source>

</properties>

</destination>

6. reboot tomcat

7. in flash builder 4.5, create "flex project", 设置下列选项

* application server type: java

* select "use remote object access server" option

* select "Blazeds" option

* Root folder: 指向step 1创建的目录

* Root URL: http://localhost:8080/blazeds
* Context root: /blazeds

8. click "Validate Configuration" button, and then click "Finish"

9. 在flash builder里找到"Data/Services" View,click "Connect to Data/Service...", 选择"blazeds", click "next", 然后select "No Password Required" and then click OK (This works because the useAppSecurity parameter of RDSDispatchServlet is set to false in web.xml.)

10. 勾上SimpleCustomerServiceDestination, and then click "Finish".

11. 在mxml file里添加一个label,and then right click the label, select "Bind to Data..",选好要操作的东东

12. run the mxml file
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: