LPS-39221 dont throw exception on weblogic as it works differently
LPS-39221 don't flush if nothing is written - makes weblogic happy
LPS-39221 Different fix - check if we need to use the printWriter first and exit if not
LPS-39221 Let's also close printWriter?
LPS-39221 Source formatting
LPS-39221 I'm not sure you should "close" those, can you ask Igor? Thanks.