well, I have some idea:
ByteArrayOutputStream baos = new ByteArrayOutputStream();
................
.........
.....
.
add(new Link("download") {
public void onClick() {
WebResponse response = (WebResponse) getResponse();
response.setHeader("Content-Disposition",
"attachment;filename=" + "aaa.xls");
response.setContentType("application/x-msdownload");
response.getOutputStream().write(baos.toByteArray());
baos.flush();
baos.close();
}});
It's work! very easy, like a Servlet, but above codes need some
try-catch-finally block.
Nino.Martinez wrote:
>
> take a look at DynamicImageResource.. It should give some hints.
>
>
>
> rosen jiang wrote:
>> Hi all,
>>
>> I want use DynamicByteArrayResource class download Excel(ByteArray
>> Resource
>> not File) from jexcelapi.
>> Does DynamicByteArrayResource class fit for me?
>>
>> thx!
>> best regards,
>> osen jiang
>>
>
> --
> -Wicket for love
>
> Nino Martinez Wael
> Java Specialist @ Jayway DK
> http://www.jayway.dk
> +45 2936 7684
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/Have-any-DynamicByteArrayResource-sample--tp16525712p16537476.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]