How to use Wicket’s DownloadLink with a file generated on the fly?

Can’t you use the constructor that takes a Model as argument? And make the Model generate the File in its getObject(). A LoadableDetachableModel is a good choice, given that load(), and therefore file generation, will be invoked only once. If the file is to be freshly generated every time the link is clicked, use DownloadLink.setDeleteAfterDownload(true) … Read more

delete version number in url

In Application.init(): mount(new MountedMapperWithoutPageComponentInfo(“/subpage”, MyPage.class)); with the following Mapper class: public class MountedMapperWithoutPageComponentInfo extends MountedMapper { public MountedMapperWithoutPageComponentInfo(String mountPath, Class<? extends IRequestablePage> pageClass) { super(mountPath, pageClass, new PageParametersEncoder()); } @Override protected void encodePageComponentInfo(Url url, PageComponentInfo info) { // do nothing so that component info does not get rendered in url } @Override public Url mapHandler(IRequestHandler … Read more

Scope ‘session’ is not active for the current thread; IllegalStateException: No thread-bound request found

The problem is not in your Spring annotations but your design pattern. You mix together different scopes and threads: singleton session (or request) thread pool of jobs The singleton is available anywhere, it is ok. However session/request scope is not available outside a thread that is attached to a request. Asynchronous job can run even … Read more