1
我必须保留本地系统中本地目录中的swf文件列表,而不是在项目文件夹内。如何在Liferay vaadin portlet 6.1的浏览器中显示swf文件?
我必须使用其名称从该路径调用swf文件,并将其显示在liferay 6.1中的vaadin portlet的浏览器中。
任何人都可以请分享如何实现这个想法?
在此先感谢
我必须保留本地系统中本地目录中的swf文件列表,而不是在项目文件夹内。如何在Liferay vaadin portlet 6.1的浏览器中显示swf文件?
我必须使用其名称从该路径调用swf文件,并将其显示在liferay 6.1中的vaadin portlet的浏览器中。
任何人都可以请分享如何实现这个想法?
在此先感谢
对于这一点,你必须使用流资源..只要勾选下面的示例代码..
最好的运气为你的签证过程:)
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);
感谢帮助 – nirmal90