[ 
https://issues.apache.org/jira/browse/WICKET-286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Matej Knopp closed WICKET-286.
------------------------------


> included AJAX JavaScript not exists, exception is thrown
> --------------------------------------------------------
>
>                 Key: WICKET-286
>                 URL: https://issues.apache.org/jira/browse/WICKET-286
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 2.0
>         Environment: Linux, NetBeans, Glassfish V2, JDK 6
>            Reporter: József Börcsök
>         Assigned To: Matej Knopp
>             Fix For: 1.3, 2.0
>
>
> My page has an AjaxSubmitLink and the javascript in HTML source 
> (wicket-ajax.js, wicket-ajax-debug.js, ... ) for that component is not exists 
> because of an exception.
> The exception is thrown in wicket.markup.html.JavascriptPackageResource at 
> line 133: ByteArrayOutputStream is created with negative (-1) length.
> The following patch checks the size and creates stream with a not negative 
> value. My AJAX link works with it but I did not verified if it is the right 
> fix.
> Index: JavascriptPackageResource.java
> ===================================================================
> --- JavascriptPackageResource.java      (revision 507233)
> +++ JavascriptPackageResource.java      (working copy)
> @@ -130,7 +130,8 @@
>                                         }
>                                 }
> -                               ByteArrayOutputStream out = new 
> ByteArrayOutputStream((int)stream.length());
> +                               final int length = (int)stream.length();
> +                               ByteArrayOutputStream out = new 
> ByteArrayOutputStream(length > -1 ? length : 0);
>                                 Streams.copy(stream.getInputStream(), out);
>                                 stream.close();
>                                 ret = filterContent(out.toByteArray());

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to