Flash 如何在Liferay vaadin portlet 6.1的浏览器中显示swf文件?
我必须将swf文件列表保存在本地系统的本地目录中,而不是项目文件夹中 我必须使用其名称从该路径调用swf文件,并在liferay 6.1中的vaadin portlet浏览器中显示它 谁能分享一下如何实现这一目标的想法Flash 如何在Liferay vaadin portlet 6.1的浏览器中显示swf文件?,flash,liferay,vaadin,Flash,Liferay,Vaadin,我必须将swf文件列表保存在本地系统的本地目录中,而不是项目文件夹中 我必须使用其名称从该路径调用swf文件,并在liferay 6.1中的vaadin portlet浏览器中显示它 谁能分享一下如何实现这一目标的想法 提前感谢您,您必须使用流资源。。只需检查下面的示例代码 祝您在签证过程中好运:) Window window = new Window(); setMainWindow(window); Label label = new Label("Embed t
提前感谢您,您必须使用流资源。。只需检查下面的示例代码 祝您在签证过程中好运:)
Window window = new Window();
setMainWindow(window);
Label label = new Label("Embed tag");
label.setDebugId("lblMsg");
window.addComponent(label);
StreamSource s = new StreamResource.StreamSource() {
@Override
public InputStream getStream() {
File f = new File("C:/test/test.swf");
FileInputStream fis=null;
try {
fis = new FileInputStream(f);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return fis;
}
};
StreamResource r = new StreamResource(s,"application/x-shockwave- flash",getMainWindow().getApplication());
Embedded e = new Embedded();
e.setType(Embedded.TYPE_OBJECT);
e.setMimeType("application/x-shockwave-flash");
e.setSource(r);
e.setWidth("400px");
e.setHeight("400px");
window.addComponent(e);