src/main/java/org/efaps/ui/wicket/behaviors/AjaxDownloadBehavior.java
@Override
    public void onRequest()
    {
        final String fileName = getFileName();
        final IResourceStream stream = getResourceStream();
        final ResourceStreamRequestHandler handler = new ResourceStreamRequestHandler(stream, fileName);
        handler.setContentDisposition(ContentDisposition.ATTACHMENT);
        getComponent().getRequestCycle().scheduleRequestHandlerAfterCurrent(handler);
    }
@Override
    public void onRequest()
    {
        final String fileName = getFileName();
        final IResourceStream stream = getResourceStream();
        final ResourceStreamRequestHandler handler = new ResourceStreamRequestHandler(stream, fileName);
        handler.setContentDisposition(ContentDisposition.ATTACHMENT);
        getComponent().getRequestCycle().scheduleRequestHandlerAfterCurrent(handler);
    }
On request, respond with a ResourcStream.