Originally posted by Vishal Chugh:
Hi cesar,
Sorry i dont get it , Could you please explain more?
I know <%! %> is used for declaring class variables and methods , I dint get that how using block {} makes it working (that also from inside JSP declarration) ? what was the problem without using block?
Thanks
Vishal Chugh
When using inside a block it become a instance block in the generated
servlet. So you can put the code like in any other method. But without a block, those code ended up as they are,
in the instance/class member declaration level. They can only go inside a method or a block.., so it won't compile. It's pure
java once you identify the type of JSP code (declaration in this case).