Flex integration of JAVA, JAVA returned from a XML file, then the datagrid values FLEX

Project. I FLEX page to access a JSP page called from the JSP page to get a XML. I have to the collection of the datagrid display in the FLEX approach.

The following is the code of my LogFlex

<? Xml version = "1.0" encoding = "utf-8"?>
<Mx: Application xmlns: mx = " http://www.adobe.com/2006/mxml "Layout =" absolute "creationComplete =" httpSrv.send (); init (); "borderColor =" # FBFDFE "backgroundGradientAlphas = "[1.0, 1.0]" backgroundGradientColors = "[# FFFFFF, # F9F5F5]">
<mx:Script>
<! [CDATA [
import mx.rpc.events.FaultEvent;
import mx.controls.Alert;
import mx.rpc.events.ResultEvent;
import mx.collections.ArrayCollection;
import common.flex.LogBeanAs;
import mx.rpc.events.FaultEvent;
import mx.controls.Alert;
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
import mx.collections.ArrayCollection;

[Bindable]
private var aclog: ArrayCollection;

function serviceHandler (event: ResultEvent): void
(
aclog = httpSrv.lastResult.root.log as ArrayCollection; / / there is httpSrv.lastResult get back to that set, and then from the root / log node start value
)
function serviceErrorHandler (event: FaultEvent): void
(
Alert.show (event.fault.message);
)
function init (): void
(
/ / Security.loadPolicyFile (" http://192.168.61.135:8080/BossForKindergarden/crossdomain.xml ");
)
]]>
</ Mx: Script>
<Mx: HTTPService url = " http://192.168.61.135:8080/BossForKindergarden/admin/systemmanage/log/LogXml.jsp "Fault =" serviceErrorHandler (Event) "result =" serviceHandler (Event) "/>

<Mx: DataGrid dataProvider = "(aclog)" styleName = "table" headerStyleName = "tableHeader" textAlign = "left" resizableColumns = "true" width = "100%" height = "100%" editable = "true" x = "153.5" y = "226">
<mx:columns>
<mx:DataGridColumn dataField="perid" headerText=" Login ID"/>
<mx:DataGridColumn dataField="remoteip" headerText=" Login IP"/>
<mx:DataGridColumn dataField="date" headerText=" Logon hours "/>

<! - The code office perid, remoteip, date and the JSP page must return the same XML document elements ->
</ Mx: columns>
</ Mx: DataGrid>

</ Mx: Application>

In the code access through httpservice http://192.168.61.135:8080/BossForKindergarden/admin/systemmanage/log/LogXml.jsp made a collection.

The visit http://192.168.61.135:8080/BossForKindergarden/admin/systemmanage/log/LogXml.jsp

Code is as follows. Returns a XML file

< % @ page contentType = "text / html; charset = GB2312"%>
< % @ page language = "Java" import = "java.util .*" pageEncoding = "GBK"
isELIgnored = "false"%>
< % @ page import = "common.datagrid.DataGrid"%>
< % @ page buffer = "none"%>
< % @ page import = "java.sql .*"%>
< % @ page import = "java.util .*"%>
< % @ page import = "common.flex .*"%>
< % @ page import = "common.util .*"%>
< % @ page import = "common.util.db4o .*"%>

<? Xml version = "1.0" encoding = "UTF-8"?>
<root>
<%
LogMessageDao logdao = (LogMessageDao) config.getServletContext (). GetAttribute ("LogDao");

List <LogMessage> list = logdao.getAllMessage ();
for (int i = 0; i <list.size (); i + +)
(
LogMessage lg = (LogMessage) list.get (i);
%>
<log>
<perid> <% = lg.getPerID ()%> </ perid>
<remoteip> <% = lg.getRemoteIP ()%> </ remoteip>
<date> <% = lg.getDate ()%> </ date>
</ Log>
<%
)

%>
</ Root>

分类:Tech 时间:2010-09-16 人气:258
分享到:
blog comments powered by Disqus

相关文章

  • java parse xml file in four ways (change) 2009-09-26

    Keywords: java 1. Introduction 1) DOM (JAXP Crimson parser) DOM is platform-and language-independent manner in the official W3C standard XML documents. DOM is a hierarchical organization of nodes or a collection of pieces of information. This hierarc

  • java read xml file four ways 2010-03-21

    xml file is: <? xml version = "1.0" encoding = "UTF-8"?> <HD> <disk name="C" name1="C1"> <capacity> 8G </ capacity> <directories> 200 </ directories> <files> 1580 <

  • Java parsing XML documents (2): sax read xml file export excel 2010-03-22

    1. Concept SAX (Simple API for XML), event-based XML Simple API, parsing XML documents is one of the two API. 2. Sax parsing 1. Use to the package: javax.xml.parsers: parser factory tools org.xml.sax: provides the core SAX API For example: import jav

  • java read xml file problem 2010-09-11

    Xml file in a format known as follows: <?xml version="1.0" encoding="UTF-8"?> <main version='2'> <item IsFolder="0" name="TWaver Online community» Want to know the heart she/he / Where is it? ?" addti

  • java read xml file in four ways [turn] 2011-09-21

    Xml Code <? Xml version = "1.0" encoding = "GB2312"?> <RESULT> <VALUE> <NO> A1234 </ NO> <ADDR> Zhengzhou, Henan Province </ ADDR> </ VALUE> <VALUE> <NO> B1234 </ NO> &l

  • java read xml instance 2010-03-29

    <?xml version="1.0" encoding="UTF-8"?> <book> < Book name ="java"> I am a java </ Books > < Book name ="c++"> I am a c ++</ Books > < Book name ="php"> I am a php

  • Java by XML Schema validation XML 2010-03-29

    Java by XML Schema validation XML XML validation in the XML processing is very common, if there is no effective way to verify the legitimacy of XML, often lead to many problems. XML validation by XML Schema (XSD) or DTD file to verify the syntax spec

  • Java parsing XML Xiangjie 2010-03-29

    The following give us a presentation of the four methods of Java parsing XML, let us to understand the concept, and then were used to explain a simple example of application method. The first is: DOM parsing (JAXP Crimson parser) DOM is platform-and

  • java operation xml w3c and xml store your picture files 2010-03-29

    // File 1 package com.kelsen.beans.imagehelper; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.DataOutputStream; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputS

iOS 开发

Android 开发

Python 开发

JAVA 开发

开发语言

PHP 开发

Ruby 开发

搜索

前端开发

数据库

开发工具

开放平台

Javascript 开发

.NET 开发

云计算

服务器

Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 闽ICP备15018612号

processed in 0.088 (s). 11 q(s)