在我之前的兩篇文章Flex
我使用的是Eclipse
有了上面的目標
Java程序的運行環境都配置好了
這是一個簡單的表
所有必要的資源准備完畢
package org
/**
* Flex Group Object
* @author rosen jiang
* @since
*
*/
public class FlexGroup {
private String groupName;
private String member
private String member
private String member
private String member
private String member
public String getGroupName() {
return groupName;
}
public void setGroupName(String groupName) {
this
}
public String getMember
return member
}
public void setMember
mber
}
public String getMember
return member
}
public void setMember
mber
}
public String getMember
return member
}
public void setMember
mber
}
public String getMember
return member
}
public void setMember
mber
}
public String getMember
return member
}
public void setMember
mber
}
}
沒啥好說的
為了讓自己和大家了解
的確
接下來是接口
disconnect()
getOperation()
hasOwnProperty()
initialized()
isPrototypeOf()
logout()
propertyIsEnumerable()
setCredentials()
setPropertyIsEnumerable()
setRemoteCredentials()
toString()
valueOf()
如果你不小心用到了
package org
import java
/**
* DAO Interface
* @author rosen jiang
* @since
*
*/
public interface ListDAO {
/**
*
*/
public List<FlexGroup> getData(FlexGroup fg);
}
然後是實現類
package org
import java
import java
import java
import org
import org
import org
/**
* DAO Impl
* @author rosen jiang
* @since
*
*/
public class ListDAOImpl extends JdbcDaoSupport implements ListDAO {
/**
*
*/
public List<FlexGroup> getData(FlexGroup fg){
//test properties
System
System
System
System
System
System
//Jdbc Template
JdbcTemplate jt = this
List<FlexGroup> list = jt
new RowMapper() {
public FlexGroup mapRow(ResultSet rs
FlexGroup fg = new FlexGroup();
fg
fg
fg
fg
fg
fg
return fg;
}
});
return list;
}
}
開始寫
<?xml version=
<web
<!
<servlet>
<servlet
<servlet
<init
<param
<param
</init
<load
</servlet>
<!
<servlet
<servlet
<url
</servlet
</web
最後是
<?xml version=
<beans xmlns=
xmlns:flex=
xmlns:xsi=
xsi:schemaLocation=
;
<!
<bean id=
<property name=
<property name=
<property name=
<property name=
</bean>
<!
<flex:message
<!
<bean id=
<property name=
<ref bean=
</property>
<flex:remoting
</bean>
</beans>
這裡引入了flex命名空間
Flex部分就兩個文件
package{
[Bindable]
[RemoteClass(alias=
public class FlexGroup{
public var groupName:String;
public var member
public var member
public var member
public var member
public var member
}
}
利用[RemoteClass(alias=
最後一個是
<?xml version=
<mx:Application xmlns:mx=
verticalAlign=
<mx:RemoteObject id=
<mx:channelSet>
<mx:ChannelSet>
<mx:channels>
<mx:AMFChannel
uri=
</mx:channels>
</mx:ChannelSet>
</mx:channelSet>
</mx:RemoteObject>
<mx:Script>
<![CDATA[
import mx
import mx
import ntrols
import llections
var fg:FlexGroup;
var ac:ArrayCollection;
private function init():void{
//create FlexGroup instance for remote DAO
fg = new FlexGroup();
fg
mber
mber
mber
mber
mber
}
private function handleResult(event:ResultEvent):void{
ac = ArrayCollection(event
dg
}
private function handleFault(event:FaultEvent):void{
Alert
}
]]>
</mx:Script>
<mx:Panel height=
<mx:VBox>
<mx:ApplicationControlBar dock=
<mx:Button label=
</mx:ApplicationControlBar>
<mx:DataGrid height=
<mx:columns>
<mx:DataGridColumn headerText=
<mx:DataGridColumn headerText=
<mx:DataGridColumn headerText=
<mx:DataGridColumn headerText=
<mx:DataGridColumn headerText=
<mx:DataGridColumn headerText=
</mx:columns>
</mx:DataGrid>
</mx:VBox>
</mx:Panel>
</mx:Application>
在這裡引入了
同時可以到Eclipse控制台上觀察收到的數據
到此
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/19765.html