[
https://issues.apache.org/jira/browse/WICKET-4301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13170408#comment-13170408
]
Bertrand Guay-Paquet commented on WICKET-4301:
----------------------------------------------
Please validate the patch. It works in my tests, but I'm not 100% sure if it's
right. In particular, should the following 2 statements be executed if
data==null?
response.setContentLength(0);
configureResponse(response, attributes); // <--- DynamicImageResource calls
this even if data is null
> ByteArrayResource throws error if data is null
> ----------------------------------------------
>
> Key: WICKET-4301
> URL: https://issues.apache.org/jira/browse/WICKET-4301
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5.3
> Reporter: Bertrand Guay-Paquet
> Priority: Minor
> Labels: resource
> Attachments: ByteArrayResource.patch
>
>
> When
> ByteArrayResource#getData(org.apache.wicket.request.resource.IResource.Attributes)
> returns null, the class throws a WicketRuntimeException.
> This behavior differs from DynamicImageResource and ResourceStreamResource
> which instead issue the following call:
> response.setError(HttpServletResponse.SC_NOT_FOUND);
> ByteArrayResource should follow the same behavior. This would allow for
> instance to use it for resources which depend on the contents of
> attributes.getParameters(). When the parameters are invalid, a 404 should be
> issued instead of an exception.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira