---
title: "解决办法：“在Flex中设置DataGrid的数据源，提示为null”"
author: "hlzhou"
date: "2010-12-19T11:08:36Z"
tags: ["Flex", "Hibernate", "MySQL", "Spring", "Tomcat"]
categories: ["Web前端"]
slug: "flex-datagrid-null"
draft: false
lastmod: "2010-12-19T11:10:03Z"
id: 846528
url: "https://hlzhou.iteye.com/blog/846528"
---

解决办法：“在Flex中设置DataGrid的数据源，提示为null”

运行环境：MyEclipse8.5GA,Flex Builder4 plugin. BlazeDS,MySQL,tomcat6

先行配置：Spring Hibernate blazeDS

 

在remoting-config.xml中，配置片段为：

&lt;destination id=*"Hello"*&gt;

    &lt;properties&gt;

&lt;!--       &lt;factory&gt;spring&lt;/factory&gt;--&gt;

&lt;!--       &lt;source&gt;helloWorldBean&lt;/source&gt;--&gt;

    &lt;source&gt;Util.HelloWorld&lt;/source&gt;                   --对应源文件所在位置

    &lt;/properties&gt;

&lt;/destination&gt;

 

这样就让BlazeDS载入数据源。重启Tomcat.

重新配置这段配置文件：

 

&lt;destination id=*"Hello"*&gt;

    &lt;properties&gt;

       &lt;factory&gt;spring&lt;/factory&gt;              --对应Spring Bean所在位置

       &lt;source&gt;helloWorldBean&lt;/source&gt;

&lt;!--&lt;source&gt;Util.HelloWorld&lt;/source&gt;--&gt;

    &lt;/properties&gt;

&lt;/destination&gt;

 

重启Tomcat.

这样就关联起来了Spring,DataGrid里填入了数据，不会提示DataGrid里的数据为null了。