Im trying to integrate PLUpload into my wicket application. First steps are looking clear. Im able to choose files and when i click the "upload"-button i receive an request on server-side in my PLUploadBehavior based on AbstractDefaultAjaxBehavior. But it does not seems to be a MultiPart request.

public abstract class PLUploadBehavior extends AbstractDefaultAjaxBehavior {

public PLUploadBehavior() {

}

@Override
public void renderHead(final Component component, IHeaderResponse response) {
    super.renderHead(component, response);
    response.render(JavaScriptHeaderItem.forReference(new JavaScriptResourceReference(PLUploadBehavior.class, "plupload.full.min.js"));


    StringBuffer script = new StringBuffer();
    //build the init-script...
    response.render(OnLoadHeaderItem.forScript(script.toString()));
}

@Override
protected void respond(AjaxRequestTarget target) {
    Request request = getComponent().getRequest();
    //received request here, but don't know hot to access files

    if (request instanceof IMultipartWebRequest) {
        System.out.println("Multipart!!!");
    }
}

}

I followed the tutorial for plupload and have no form in my html template. There is none in the tutorial, so i think i don't need it. Anyone an idea to access the files on server-side?

有帮助吗?

解决方案

After some more coffee i found the solution to my problem. The example on wicket in action can get adapted to the use with an Behavior. Thanks to Martin Grigorov and the great Wicket Team!

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top