wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrea Del Bene <an.delb...@gmail.com>
Subject Re: Wicket 6.2.0 and MultipartServletWebRequestImpl
Date Wed, 31 Oct 2012 11:58:52 GMT
Yes it should be enough.
> Hello,
> after a second closer look I figured I should override newWebRequest in
> my WicketApplication extends WebApplication, right?
> So now I have:
> @Override
> public WebRequest newWebRequest(HttpServletRequest servletRequest,
> String filterPath) {
> WebRequest webRequest = super.newWebRequest(servletRequest, filterPath);
>
> String contentType = servletRequest.getContentType();
> String method = servletRequest.getMethod();
> if (webRequest instanceof ServletWebRequest
> && Form.METHOD_POST.equalsIgnoreCase(method)
> && Strings.isEmpty(contentType) == false
> && contentType.toLowerCase().startsWith(
> Form.ENCTYPE_MULTIPART_FORM_DATA)) {
> try {
> return ((ServletWebRequest) webRequest).newMultipartWebRequest(
> getApplicationSettings().getDefaultMaximumUploadSize(),
> "externalForm");
> } catch (FileUploadException e) {
> throw new RuntimeException(e);
>
> }
> }
>
> return webRequest;
> }
>
> That seems to work. Am I still missing something?
> Thanks
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Mime
View raw message