首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

flex组合java连接数据库

2011-12-22 
flex结合java连接数据库本人最近由于工作项目需要改造http://www.flex2.org/node/85中的效果一,,其源代码

flex结合java连接数据库
本人最近由于工作项目需要改造http://www.flex2.org/node/85中的效果一,,其源代码为:

<?xml   version= "1.0 "   encoding= "utf-8 "?>
<!--
Copyright   (c)   2006   Adobe   Systems   Incorporated

Permission   is   hereby   granted,   free   of   charge,   to   any   person
obtaining   a   copy   of   this   software   and   associated   documentation
files   (the   "Software "),   to   deal   in   the   Software   without
restriction,   including   without   limitation   the   rights   to   use,
copy,   modify,   merge,   publish,   distribute,   sublicense,   and/or   sell
copies   of   the   Software,   and   to   permit   persons   to   whom   the
Software   is   furnished   to   do   so,   subject   to   the   following
conditions:

The   above   copyright   notice   and   this   permission   notice   shall   be
included   in   all   copies   or   substantial   portions   of   the   Software.

THE   SOFTWARE   IS   PROVIDED   "AS   IS ",   WITHOUT   WARRANTY   OF   ANY   KIND,
EXPRESS   OR   IMPLIED,   INCLUDING   BUT   NOT   LIMITED   TO   THE   WARRANTIES
OF   MERCHANTABILITY,   FITNESS   FOR   A   PARTICULAR   PURPOSE   AND
NONINFRINGEMENT.   IN   NO   EVENT   SHALL   THE   AUTHORS   OR   COPYRIGHT
HOLDERS   BE   LIABLE   FOR   ANY   CLAIM,   DAMAGES   OR   OTHER   LIABILITY,
WHETHER   IN   AN   ACTION   OF   CONTRACT,   TORT   OR   OTHERWISE,   ARISING
FROM,   OUT   OF   OR   IN   CONNECTION   WITH   THE   SOFTWARE   OR   THE   USE   OR
OTHER   DEALINGS   IN   THE   SOFTWARE.
-->
<Application   xmlns= "http://www.adobe.com/2006/mxml "   xmlns:local= "* "   height= "100% "   width= "100% "   layout= "absolute "   viewSourceURL= "download/index.html ">
 
  <Binding   source= "sel.value "   destination= "shelf.selectedIndex "   />
  <Binding   destination= "sel.value "   source= "shelf.selectedIndex "   />
 
  <Binding   source= "angle.value "   destination= "shelf.angle "   />
  <Binding   source= "pop.value "   destination= "shelf.popout "   />

  <Array   id= "dataSet ">
    <String> img/photos400/01000.jpg </String>      
    <String> img/photos400/01001.jpg </String>      
    <String> img/photos400/01002.jpg </String>      
    <String> img/photos400/01003.jpg </String>      
    <String> img/photos400/01004.jpg </String>      
    <String> img/photos400/01005.jpg </String>      
    <String> img/photos400/01006.jpg </String>      


    <String> img/photos400/01007.jpg </String>      
    <String> img/photos400/01008.jpg </String>      
    <String> img/photos400/01009.jpg </String>      
    <String> img/photos400/01010.jpg </String>      
    <String> img/photos400/01012.jpg </String>      
    <String> img/photos400/01013.jpg </String>      
    <String> img/photos400/01014.jpg </String>      
    <String> img/photos400/01015.jpg </String>      
    <String> img/photos400/01016.jpg </String>      
    <String> img/photos400/01017.jpg </String>      
    <String> img/photos400/01018.jpg </String>      
    <String> img/photos400/01019.jpg </String>          
  </Array>

 
  <local:DisplayShelf   id= "shelf "     horizontalCenter= "0 "   verticalCenter= "0 "
    borderThickness= "10 "   borderColor= "#FFFFFF "   dataProvider= "{dataSet} "     enableHistory= "false "   width= "100% "/>

  <VBox   horizontalCenter= "0 "   bottom= "10 "
    horizontalAlign= "center "   verticalAlign= "middle "   >      

    <HBox>
      <Label   text= "Angle: "   />
      <HSlider   liveDragging= "true "   id= "angle "   minimum= "5 "   value= "35 "   maximum= "90 "   snapInterval= ".1 "   width= "400 "   />
    </HBox>

    <HBox>
      <Label   text= "Selection: "   />
      <HSlider   liveDragging= "true "   id= "sel "   minimum= "0 "   value= "0 "   maximum= "{shelf.dataProvider.length} "   snapInterval= "1 "   width= "400 "   />
    </HBox>

    <HBox>
      <Label   text= "pop: "   />
      <HSlider   liveDragging= "true "   id= "pop "   minimum= "0 "   value= ".43 "   maximum= "1 "   snapInterval= ".01 "   width= "400 "   />
    </HBox>

  </VBox>
</Application>


 

现在我想把上面的字符串改造成从数据库中读取,我改造的程序的部分代码如下:

<?xml   version= "1.0 "   encoding= "utf-8 "?>
<Application   xmlns:mx= "http://www.adobe.com/2006/mxml "   fontSize= "12 "  
  xmlns= "http://www.adobe.com/2006/mxml "  
  xmlns:local= "* "   height= "100% "   width= "100% "  
  layout= "absolute "  
  viewSourceURL= "index.html "  
  creationComplete= "initApp() "
  >



 

<mx:Script>
      <![CDATA[
    import   mx.controls.Alert;
    import   mx.utils.ArrayUtil;
                import   mx.collections.ArrayCollection;
             
                //保存返回图片事件集合的内容
                [Bindable]
              public   var   imgList:Array;
             
              //初始化程序,调用图片对象的返回图片集,送将结果送给flex事件集
                public   function   initApp():void
                        {
                            src.getAllImg();
                        }
      ]]>
        </mx:Script>
        <Binding   source= "sel.value "   destination= "shelf.selectedIndex "   />
  <Binding   destination= "sel.value "   source= "shelf.selectedIndex "   />
 
  <Binding   source= "angle.value "   destination= "shelf.angle "   />
  <Binding   source= "pop.value "   destination= "shelf.popout "   />
 
  <!--本地化远程返回图片的对象-->
      <mx:RemoteObject   id= "src "  
  destination= "imageDB "  
  result= "imgList=ArrayUtil.toArray(event.result) "  
  fault= "Alert.show(event.fault.faultString, 'Error ') "
  />
 
  <local:DisplayShelf   id= "shelf "    
    dataProvider= "{imgList} "
    horizontalCenter= "0 "   verticalCenter= "0 "  
    borderThickness= "5 "   borderColor= "#FFFFFF "  
    enableHistory= "false "   width= "100% "  
    />

  .....   ...  

        但生成的代码后,图片显示了,但无论如何调整那个滑条都没效果!!我研究了都快两周了,效果还是不知道怎么加上去,哪位高手或者好心人帮我看下,告诉我为什么啊


[解决办法]
哥们强烈关注,我也在研究,好象要安装data service.
等你的研究成果.
[解决办法]
flex 好用否?
[解决办法]
嗯,Flex+Spring+Hibernate的商业软件,可以在线演示的

http://www.mybaicai.com/tryout/

热点排行