flash / struts : how to display a dynamic flash document
hi,
i want display flash document dependant on context. choice of document performed struts action must return content of flash.
i use following environment: ie 8, jsp, struts, tomcat, oracle
here jsp code:
<object
id = "banner"
classid="clsid:d27cdb6e-ae6d-11cf-96b8-44553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="<bean:write name="topbanner" property="width"/>" height="<bean:write name="topbanner" property="height"/>"> <param name="movie" value="banner.do?frame=top"/>
<param name="quality" value="high"/>
</object>
here generated html code:
<object id = "banner" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
width="400"
height="60">
<param name="movie" value="banner.do?frame=top"/>
<param name="quality" value="high"/>
</object>
you find below extract of java code of associated struts action (banneraction.java)
public actionforward executeaction(actionmapping mapping, actionform actionform,
httpservletrequest req,
httpservletresponse res) throws systemexception, applicativeexception {
….
servletoutputstream out = res.getoutputstream ( );
// name of flash file found after database request
string fullname = …..
res.setheader ( "content-disposition", "attachment; filename=\"" + name + "\"" ) ;
fileinputstream fis = null;
// return file
try {
fis = new fileinputstream ( fullname ) ;
byte [ ] buf = new byte [ 32768 ] ;
int bytesread;
while ( ( bytesread = fis.read ( buf ) ) != -1 )
out.write ( buf, 0, bytesread ) ;
}
catch ( filenotfoundexception e ) {
….
}
return null;
}
the result blank zone instead of flash.
does have idea ?
thank in advance,
regards
More discussions in Using Flash Player
adobe
Comments
Post a Comment