티스토리 뷰
출처
http://livedocs.adobe.com/flex/1/asdocs/mx/servicetags/HTTPService.html
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
creationComplete="init()">
<mx:Script>
<![CDATA[
import mx.collections.*;
import mx.rpc.http.HTTPService;
import mx.controls.dataGridClasses.DataGridColumn;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
public var httpData:HTTPService;
[Bindable]
public var xlcData:XMLListCollection;
public function init():void
{
var params:Object = new Object();
params.keyname = "freeboard";
params.qryname = "list";
httpData = new HTTPService();
httpData.url = "http://localhost:8080/examples/xmldata.jsp";
httpData.method = "POST";
httpData.resultFormat="e4x";
httpData.addEventListener("result", resultHandler);
httpData.addEventListener("fault", faultHandler);
httpData.send(params);
}
public function resultHandler(e:ResultEvent):void
{
var xlData:XMLList = new XMLList(e.result);
// mx.controls.Alert.show(xlData.data.row.toXMLString());
grid1.dataProvider = xlData.data.row;
}
public function faultHandler(e:FaultEvent):void
{
mx.controls.Alert.show("데이타를 읽는 중 에러\n"+e.fault.faultString);
}
]]>
</mx:Script>
<mx:DataGrid id="grid1" x="233" y="177" width="457">
<mx:columns>
<mx:DataGridColumn headerText="Column 1" dataField="c1"/>
<mx:DataGridColumn headerText="Column 2" dataField="c2"/>
</mx:columns>
</mx:DataGrid>
</mx:Application>
xmldata.jsp
<%@ page language="java" contentType="text/xml" %>
<%@ page import="meta.*"%>
<%
String keyname= request.getParameter("keyname");
String qryname= request.getParameter("qryname");
System.out.println(keyname + "/" + qryname);
String xmldata = MetaBoard.getInstance().getQueryRun(keyname, qryname);
%>
<root>
<%=xmldata%>
</root>
- Total
- Today
- Yesterday
- 레이싱모델 익스트림 포토 페스티벌
- android
- JavaScript
- ubuntu
- Java
- 지스타2007
- NDK
- 서울오토살롱
- oracle
- KOBA
- koba2010
- ble
- 전예희
- Delphi
- SAS
- BPI-M4
- 튜닝쇼 2008
- 송주경
- Delphi Tip
- sas2009
- 동경
- ffmpeg
- flex
- Xcode
- Mac
- Linux
- MySQL
- 일본여행
- Spring
- Spring MVC
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |