compress a large jsp page (e.g. 2MBytes) leads to messed up html code with
%%%COMPRESS~EVENT~1.000%%% to %%%COMPRESS~EVENT~11.687%%% fragments in the ouput
caused by HtmlCompressor:preserveBlocks
calls of java.text.MessageFormat.format("%%%COMPRESS~EVENT~{0}%%%", new
Object[] {Integer.valueOf(index)})
have to be MessageFormat.format("%%%COMPRESS~EVENT~{0,number,#}%%%", new
Object[] {Integer.valueOf(index)})
can be reproduced with this sample code
for(int index=995; index< 1005; index++){
// all COMPRESS~???~ patterns are wrong for i>=1000 (at least in HtmlCompressor.java)
String bad = java.text.MessageFormat.format("%%%COMPRESS~EVENT~{0}%%%" , new Object[] {Integer.valueOf(index)});
String good = java.text.MessageFormat.format("%%%COMPRESS~EVENT~{0,number,#}%%%", new Object[] {Integer.valueOf(index)});
System.out.println("bad: "+bad +", good:" +good);
}
with corrected code in HtmlCompressor, html output is good
Original issue reported on code.google.com by m.konic...@gmail.com on 2 Feb 2011 at 8:31
Original issue reported on code.google.com by
m.konic...@gmail.com
on 2 Feb 2011 at 8:31