这几天弄flex,把工程部署到了tomcat下面,用的是blazeds,但是现在有个问题,如果mxml中有图片的话,在服务器加载完后就不会显示图片.例如:文件名:image.mxml
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="top"
backgroundColor="white">
<mx:Panel title="图片"
height="100%"
horizontalAlign="center" width="428" x="67">
<mx:Image source="G:\pics\汽车图标\阿尔法.jpg"/>
</mx:Panel>
</mx:Application> 就简单的加载这个页面,结果只显示了panel,但是里面的image没有显示,如果用IE直接打开image.html就是正常的,如果用http://localhost:8080/test/flexpage/image.html就不会显示图片.还有如果是图片列表,例如:<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="top"
backgroundColor="white">
<mx:Array id="arr">
<mx:Object label="Flex"
thumbnailImage="G:\pics\汽车图标\阿尔法.jpg"
fullImage="G:\pics\汽车图标\阿尔法.jpg"/>
<mx:Object label="Flash"
thumbnailImage="G:\pics\汽车图标\奥迪.jpg"
fullImage="G:\pics\汽车图标\奥迪.jpg"/>
<mx:Object label="Illustrator"
thumbnailImage="G:\pics\汽车图标\奥斯顿马丁.jpg"
fullImage="G:\pics\汽车图标\奥斯顿马丁.jpg"/>
</mx:Array>
<mx:Panel title="{horizontalList.selectedItem.label}"
height="100%"
horizontalAlign="center">
<mx:Image id="img"
source="{horizontalList.selectedItem.fullImage}"
maintainAspectRatio="true"
horizontalAlign="center"
width="{horizontalList.width}"
height="100%"/>
<mx:ControlBar horizontalAlign="center" >
<!--itemRenderer="CustomItemRenderer"-->
<mx:HorizontalList id="horizontalList"
labelField="label"
iconField="thumbnailImage"
dataProvider="{arr}"
columnCount="4"
columnWidth="200"
rowCount="1"
rowHeight="200"
horizontalScrollPolicy="on"
>
<mx:itemRenderer>
<mx:Component>
<mx:VBox horizontalAlign="center" verticalAlign="middle">
<mx:Image source="{data.thumbnailImage}"/>
<mx:CheckBox label="{data.label}"/>
</mx:VBox>
</mx:Component>
</mx:itemRenderer>
</mx:HorizontalList>
</mx:ControlBar>
</mx:Panel>
</mx:Application> 上面这段代码是图片列表.同样用IE直接打开就是正常的,但是通过服务器打开的加载页面的进度条就只加载到一半,然后就停止了..哪位大虾知道是上面原因么?小弟初学..不知道是不是图片的原因?
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="top"
backgroundColor="white">
<mx:Panel title="图片"
height="100%"
horizontalAlign="center" width="428" x="67">
<mx:Image source="G:\pics\汽车图标\阿尔法.jpg"/>
</mx:Panel>
</mx:Application> 就简单的加载这个页面,结果只显示了panel,但是里面的image没有显示,如果用IE直接打开image.html就是正常的,如果用http://localhost:8080/test/flexpage/image.html就不会显示图片.还有如果是图片列表,例如:<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="top"
backgroundColor="white">
<mx:Array id="arr">
<mx:Object label="Flex"
thumbnailImage="G:\pics\汽车图标\阿尔法.jpg"
fullImage="G:\pics\汽车图标\阿尔法.jpg"/>
<mx:Object label="Flash"
thumbnailImage="G:\pics\汽车图标\奥迪.jpg"
fullImage="G:\pics\汽车图标\奥迪.jpg"/>
<mx:Object label="Illustrator"
thumbnailImage="G:\pics\汽车图标\奥斯顿马丁.jpg"
fullImage="G:\pics\汽车图标\奥斯顿马丁.jpg"/>
</mx:Array>
<mx:Panel title="{horizontalList.selectedItem.label}"
height="100%"
horizontalAlign="center">
<mx:Image id="img"
source="{horizontalList.selectedItem.fullImage}"
maintainAspectRatio="true"
horizontalAlign="center"
width="{horizontalList.width}"
height="100%"/>
<mx:ControlBar horizontalAlign="center" >
<!--itemRenderer="CustomItemRenderer"-->
<mx:HorizontalList id="horizontalList"
labelField="label"
iconField="thumbnailImage"
dataProvider="{arr}"
columnCount="4"
columnWidth="200"
rowCount="1"
rowHeight="200"
horizontalScrollPolicy="on"
>
<mx:itemRenderer>
<mx:Component>
<mx:VBox horizontalAlign="center" verticalAlign="middle">
<mx:Image source="{data.thumbnailImage}"/>
<mx:CheckBox label="{data.label}"/>
</mx:VBox>
</mx:Component>
</mx:itemRenderer>
</mx:HorizontalList>
</mx:ControlBar>
</mx:Panel>
</mx:Application> 上面这段代码是图片列表.同样用IE直接打开就是正常的,但是通过服务器打开的加载页面的进度条就只加载到一半,然后就停止了..哪位大虾知道是上面原因么?小弟初学..不知道是不是图片的原因?
解决方案 »
- 利用pd4ml转html为pdf文件,中文乱码 求解决方法
- Spring quartz问题
- JSP中内嵌if语句为什么不起作用?
- 请教:在tomcat5种,应该如何配置让html文件执行jsp代码?100分
- 运行jsp页面,却什么不见?
- javamail发送html邮件的问题,急!!!
- 读写文本文件时,在windows系统正常,在linux下出现乱码!
- 苦恼中。谁来看看
- 关于Maven分模块web项目,代理mapper生成失败的问题
- java通过什么方法获取到plc变量信息?
- J2EE spring中:“将request请求对象绑定到线程”,这句话是什么意思啊?
- 获取不到表单数据 java.lang.NullPointerException
改成http://localhost:8080/项目名/对应的图片路径