Flex Óë servlet ͨÐÅ
servlet ¶Ë£º
String userId = request.getParameter("userId");
System.out.println(userId);
response.setCharacterEncoding("UTF-8");
response.getWriter().println("hello world -- ÎÒ°®Äã¡£¡£¡£");
Flex ǰ̨¶Ë
<fx:Script>
<![CDATA[
import flash.trace.Trace;
private var loader:URLLoader = new URLLoader();
private function asCallHandler():void{
// URL
var url:String = "http://localhost/app01/getUser";
// ²ÎÊý
var args:URLVariables = new URLVariables();
args.userId = 1;
// RequestÇëÇó
var request:URLRequest = new URLRequest(url);
request.data = args;// °ó¶¨²ÎÊý
//ÇëÇó¼ÓÔØÆ÷
loader.addEventListener(Event.COMPLETE,handleServerResponse);
loader.load(request);//·¢ËÍÇëÇó
}
private function handleServerResponse(e:Event):void{
trace("User data is loaded");
// »ñÈ¡servletÖÐprintln()µÄÄÚÈÝ
debugText.text = loader.data;
}
protected function button1_clickHandler(event:MouseEvent):void
{
// ·¢ËÍÇëÇó
asCallHandler();
}
]]>
Ïà¹ØÎĵµ£º
1.ǰ¶ËflexµÄ¶ÔÏóºÍjava¶ËµÄ¶ÔÏóÃû×ÖÒªÒ»Ö£¬java¶ËµÄ¶ÔÏó±ØÐëÐòÁл¯£¬·ñÔòÎÞ·¨±»flex¶Ëµ÷ÓÃת»¯
javaºǫ́´«»ØµÄlistÀï±ßµÄ¶ÔÏ󣬱ØÐëflex¶ËÒ²Óд˶ÔÏ󣬶øÇÒÁ½¸ö¶ÔÏóµÄÊôÐÔÒªÒ»Ö£¬·ñÔò£¬²»Äܻص÷
2.»Øµ÷º¯Êý²»Æð×÷Óã¬ÓпÉÄÜÊÇÒòΪ»Øµ÷º¯ÊýÃû×ÖÒýÆðµÄ
flex´Ójava¶ËÈ¡¶à¸ölist·â×°µÄ¶ÔÏóʱ£¬¶Ô¸÷¸ödatagridÒªÓÃÊý¾Ý° ......
flexÈýÖÖÁ¬¼¶·½Ê½:
ÄÚÁª£º<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="var codetxt:Text=new Text">
</mx:Application>
¼¶Áª£º<mx:Application xmlns:mx="http: ......
http://blog.csdn.net/xuyesheng/archive/2009/08/20/4467515.aspx
Flex
Builder3
×¢²áÂ룺
1377-4167-5844-4698-0048-5821—
×î
ºÃÓõÄÒ»¸ö
1377-4168-2018-0771-2432-1495
1377-4760-3354-0772-2773-8996
1377-4165-2080-7265-7813-8901
1377-4964-5021-8182-2399-8235
LiveCycle Data Services
×¢²áÂë ......
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal">
<mx:Script>
<![CDATA[
import mx.core.BitmapAsset;
import mx.core.DragSource;
import mx.events.DragEvent;
import mx.managers.DragManager;
private var xoffset:Number;
private var yoffset:Number;
priv ......
/*Copyright (c) 2006 Adobe Systems Incorporated
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, m ......