FLEXʹÓÃjavaÁ¬½ÓÊý¾Ý¿â,Éú³ÉtreeÊ÷
×î½ü¼¸Ìì,Ò»Ö±ÔÚÑо¿flex,˵¾äʵÔÚµÄ,ÆäÖеĿàÄÕ²»ÊÇÒ»¾ä»°Á½¾ä»°ÄÜ˵Çå³þµÄ.ûÓнӴ¥¹ý°¡!²»¹ýÏÖÔÚ×ÜËãÊÇ°ÑÊý¾Ý¿âÁ¬ÉÏÁË,×ö³öÁË×Ô¼ºÏëÒªµÄ¶«Î÷.·Ï»°ÉÙ˵,ÏÖÔÚÄØ,ÎҾͰÑÎÒ×öµÄ´úÂëÌù³öÀ´,¸ø´ó¼Ò¿´¿´,¶àÌᱦ¹óÒâ¼û.
ÎÒÓõÄÊÇjdbcµÄÁ¬½Ó·½Ê½(hibernateµÄÁ¬½Ó·½Ê½ÎÒ¿´ÍøÉÏÓÐ,ËùÒԾͲ»Ìù³öÀ´ÁË)
1.flex´úÂë
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="begin()">
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
import flash.events.MouseEvent;
import mx.controls.*;
public function begin():void{
getitem.Toxml();
}
[Bindable]
public var selectedNode:XML;
[Bindable]
public var XMLData:XMLList;
private function resultHandler(event:ResultEvent):void{
//textarea.text=event.result.toString();
XMLData = new XMLList(event.result.toString());
myTree.dataProvider = XMLData.folder;
}
public function DealFault(event:FaultEvent):void{
Alert.show(event.fault.toString());
trace(event.fault);
}
]]>
</mx:Script>
<mx:RemoteObject id="getitem" destination="getItem" showBusyCursor="true" endpoint="http://localhost:8080/firstFlex/messagebroker/amf/" fault="DealFault(event)" result="resultHandler(event)"/>
<mx:Tree id="myTree" labelField="@label" width="100%" height="100%"/>
</mx:Application>
ÔÚÕâÀïҪעÒâ,<mx:RemoteObject >Õâ¸ö±êÇ©,ÊÇÓÃÀ´Á¬½ÓÊý¾Ý¿âµÄ,ûÓÐËü¾Í²»¿ÉÄÜÁ¬ÉÏ.»¹ÓбêÇ©ÀïÃæµÄendpointÕâ¸öÊôÐÔ,ÊDZز»¿ÉÉÙµÄ,ËüµÄÖµÀ¶É«¼Ó´ÖµÄ²¿·ÖΪÏîÄ¿Ãû³Æ,»ÆÉ«¼Ó´ÖµÄ²¿·ÖÊÇÔÚÏîÄ¿web.xmlÖеÄ
<servlet-mapping>
<servlet-name>MessageBroke
Ïà¹ØÎĵµ£º
ÕâÀï·ÖÁ½ÖÖÇé¿ö£¬Ò»ÖÖÊÇÊý¾ÝÔ´ÔÚMXMLÎļþÖУ¬È磺
<mx:XML id="treeXML" format="e4x">
<root>
<node label="֪ͨͨ¸æ¹ÜÀí" data="0">
<node label="É걨֪ͨ" data="1" />
<node label="Ìî±íÐëÖª" data="1" />
......
javaÉÏ´«Îļþ
ÐèÒªµÄµÚÈý·½jar°üÓУ¨ÕâÀïʹÓÃapacheµÄ£©
apacheµÄcommons-fileupload£¨ÉÏ´«Óã©£¬commons-io £¨listenerÇåÀíÀàÓã© £¬ commons-beanutils£¨¿ÉÑ¡£©
¾ßÌå²Ù×÷
FileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload(factory);
if(ServletFileUp ......
Java
Á÷²Ù×÷
¶ÔÓÚÎÒÃdz£ÓõÄGBKÖУ¬Ó¢ÎÄÊÇÕ¼ÓÃ1¸ö×Ö½Ú£¬ÖÐÎÄÊÇ2¸ö
¶ÔÓÚUTF-8£¬Ó¢ÎÄÊÇ1¸ö£¬ÖÐÎÄÊÇ3¸ö
¶ÔÓÚUnicode£¬Ó¢ÎÄÖÐÎĶ¼ÊÇ2¸ö
Java
µÄÁ÷²Ù×÷·ÖΪ×Ö½ÚÁ÷ºÍ×Ö·ûÁ÷Á½ÖÖ¡£
1¡¢
×Ö½ÚÁ÷
ËùÓеĶÁ²Ù×÷¶¼¼Ì³Ð×ÔÒ»¸ö¹«¹²³¬Àà
java
.io.InputStream
Àà¡£
ËùÓеÄд²Ù×÷¶¼¼Ì³Ð×ÔÒ ......
ÔÎÄ£ºDependency Injection in Java EE 6 – Part 1
×÷ÕߣºReza Rahman
³ö´¦£ºhttp://www.theserverside.com/tt/articles/article.tss?l=DependencyInjectioninJavaEE6
ÕâÒ»ÎÄÕÂϵÁнéÉÜÁËJava EEµÄÉÏÏÂÎĺÍÒÀÀµ×¢È루Contexts and Dependency Injection for Java EE£¬CDI£©£¬CDIÊǼ´½«Íê³ÉµÄJava EE 6Æ½Ì ......
Java™ ÓïÑÔ°üº¬Á½ÖÖÄÚÔÚµÄͬ²½»úÖÆ£ºÍ¬²½¿é£¨»ò·½·¨£©ºÍ volatile ±äÁ¿¡£ÕâÁ½ÖÖ»úÖƵÄÌá³ö¶¼ÊÇΪÁËʵÏÖ´úÂëÏ̵߳ݲȫÐÔ¡£ÆäÖÐ Volatile ±äÁ¿µÄͬ²½ÐԽϲµ«ÓÐʱËü¸ü¼òµ¥²¢ÇÒ¿ªÏú¸üµÍ£©£¬¶øÇÒÆäʹÓÃÒ²¸üÈÝÒ׳ö´í¡£ÔÚÕâÆÚµÄ Java ÀíÂÛÓëʵ¼ù
ÖУ¬Brian Goetz ½«½éÉܼ¸ÖÖÕýȷʹÓà volatile ±äÁ¿µÄģʽ£¬²¢Õ ......