flex 和 java (web)的组合开发
1、开发环境:在myeclipse7.0中整合flex plup3.0, 安装flex plup3.0时,选myeclipse 中eclipse的目录,然
找到flex 的安装好的目录,将plugins和features对应到拷到myeclipse里面 eclipse相应的目录下。
2、创建 flex和 java (Web)的工程(通信框架用blazeds.war):
1、在myeclipse7下转到flex开发环境,创建flex工程 flexssh:
2、右键创建好的flex 工程,为flex添加 web能力,使之有web能力,才可以使用ssh框架.
二、flex和java的通信
写一个java类:
package com.qili.flexssh.test;
import com.qili.flexssh.util.UploadFile;
public class Hello {
public String say(String yourworld){
System.out.println("at:"+UploadFile.getNowDatetime()+" you say:"+yourworld);
return "at:"+UploadFile.getNowDatetime()+" you say:"+yourworld;
}
}
在WebRoot/WEB-INF/flex/remoting-config.xml 下添加
<destination id="hello_java_class"> <!-- flex mxml页面要调用的ID -->
<properties>
<source>com.qili.flexssh.test.Hello</source> <!-- java中的类 -->
</properties>
</destination>
3) 页面写 flex程序
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.events.ResourceEvent;
import mx.controls.Alert;
import mx.rpc.events.ResultEvent;
[Bindable]private var returnmess:String; //获取java类里面的方法回调的值
function sendMess():void{
var myworld:
相关文档:
文章用实例代码展示了Java中多线程访问共享资源
时线程同步
的重要性。
分别通过在两个线程中同时访问(调用get_id*方法)经过同步处理(lock及Synchronized)的共享资源(tmp)及未经过同步处理的共享资源(tmp)来说明同步处理的的作用。
main中分两部分:
1)前半部分,non-synchronization部分用来测试没有做同步处理的代码 ......
java.io.InputStream的read()方法描述:
If no byte is available because the end of the stream has been reached, the value -1 is returned.
到达流的末尾真会放回-1吗?
......
Java版支付宝接口开发
需求:调用支付宝接口的接口并集成到商城
调用支付宝接口所需要的“支付宝合作伙伴id”和“支付宝安全校验码”公司都给提供好了,支付宝官方那里也有该接口的“实物商品交易服务集成技术文档”及相关的DEMO源码。公司让我用JAVA来写,终于暂时不用再写JS了,嘿嘿&hel ......
(本文转载自:http://hi.baidu.com/edilyxin/blog/item/27dc152aba3e10315343c19c.html)
问题的提出:
编译运行下面这个程序会看到什么?
public class Test{
public static  ......
在flex中,一般直接在设计时写remoteobject的话,这个是比较普遍了,但有的时候,需要在AS代码中动态设置
remoteobject,这个比较少见,所以小结学习之:
情景是,当页面加载时,代码新建立一个remoteobject,然后设置其方法和调用参数,最后把调用返回的结果(是JAVA中的一个LIST),绑定到
一个repeater控 ......