flexͨ¹ýblazedsÓëjavaͨÐŵÄСÀý×Ó
ºÜ¼òµ¥µÄСÀý×Ó£¬ÊʺϳõѧÕßÀí½â
1£¬JavaFlex.java
package flex;
public class JavaFlex {
public String helloJavaFlex(String name) {
return name;
}
}
2£¬remoting-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<service id="remoting-service" class="flex.messaging.services.RemotingService">
<adapters>
<adapter-definition id="java-object"
class="flex.messaging.services.remoting.adapters.JavaAdapter"
default="true" />
</adapters>
<default-channels>
<channel ref="my-amf" />
</default-channels>
<destination id="firstJavaFlex">
<properties>
<source>flex.JavaFlex
</source>
</properties>
</destination>
</service>
3£¬testflex.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<fx:Declarations>
<!-- ½«·Ç¿ÉÊÓÔªËØ£¨ÀýÈç·þÎñ¡¢Öµ¶ÔÏ󣩷ÅÔÚ´Ë´¦ -->
<s:RemoteObject id="selectHello" destination="firstJavaFlex" fault="error(event)"/>
</fx:Declarations>
<fx:Script>
<!--[CDATA[
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.events.ResizeEvent;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
[Bindable]
private var arraylist:ArrayCollection = new ArrayCollection([
{name:"ÄãºÃ",data:"ÄãºÃ£¡"},
{name:"ÄãÃǺÃ",data:"ÄãÃǺã¡"},
{name:"´ó¼ÒºÃ",data:"´ó¼ÒºÃ£¡"},
]);
private function changehandler(event:Event):void{
selectHello.helloJavaFlex(selected.selectedItem.data);
selectHello.addEventListener(ResultEvent.RESULT,remoteResult);
}
private function remoteResult(event:ResultEvent):void{
Alert.show(event.result.toString());
resultmess.text = event.result.toString();
}
priv
Ïà¹ØÎĵµ£º
import java.io.*;
public class IoTest
{
public static void main(String[] args)
{
String s;
s=calculate();
System.out.println(s);
}
static String calculate()
{
StringBuffer sb=new StringBuffer("");
try{
FileReader re ......
·if ((ICO2 = getInitParameter("ICO2")) == null)
ICO2 = "images/commend.gif";
·ActionContext ctx = ActionContext.getContext();
HttpServletRequest request = (HttpServletRequest) ctx.get(ServletActionContext.HTTP_REQUEST); ......
***´ËÌâÒÔ¿¼²ì»ù´¡Îª×¼,±±¾©µÄ±ÊÊÔÌâ,¿ÉÄÜÓÐÈË×ö¹ý
Ìâ:дһ¸ö³ÌÐò£¬½âÎöÈçϸñʽµÄ×Ö·û´®£¬²¢½«½âÎöµÄÊý×ÖÐòÁдòÓ¡³öÀ´¡£
×Ö·û´®¸ñʽ¾ÙÀý£º -1~2, 3~3, 5~10, 7~15x3
~ ´ú±íÊý×ֵķ¶Î§£¬ -1~2 ´ú±í´Ó-1¿ªÊ¼µ½2Ö®¼äµÄËùÓÐÊý×Ö¡£ 3~3 ´ú±í´Ó3¿ªÊ¼µ½3µÄËùÓÐÊý×Ö£¬Ò²¾ÍÊÇ3
7~15x3´ú ......
³ÌÐòÉè¼ÆÊǽâ¾öÎÊÌâ˼·µÄ¾ßÌ廯.¾ÍÏñ½¨ÔìÒ»×ù·¿×ÓÒ»Ñù£¬ÓÃʲôÑùµÄ²ÄÁÏ,½¨Ôìʲô·ç¸ñµÄ½¨Öþ,¾ßÌåÿ¸öλÖÃÊÇʲô... ²»Í¬µÄ½¨Öþʦ»áÓв»Í¬µÄ·½·¨. ¶ø°ÑÍê³ÉijһÌض¨ÎÊÌâµÄ½â¾ö˼·¹æ·¶Ò»Ï ¾Í¿ÉÒÔ³Æ×÷ΪһÖÖÉè¼Æģʽ.
³ÌÐòÉè¼ÆÖÐÉè¼ÆģʽΪÎÒÃÇÔÚijһÎÊÌâÓòÌṩÁËÒ»ÖÖÁ¼ºÃµÄʵÏÖ·½·¨²Î¿¼£¬¿ÉÒÔ´ó´óʵÏÖ¸´Óú͸ßЧ¡£
ÏÂÃæÎ ......