This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Hi Michael, Your JSP code may have only one line of code after the 'if'. But when it gets translated into a servlet, the single line of jsp code may represented by more lines. In your case, the translated code may look like: if (str.equals("")) jspWriter.print("\n"); //<BR> jspWriter.print("str is empty"); //str is empty else jspWriter.print("\n"); //<BR> jspWriter.print("str ="); //str = jspWriter.print(str); //<%= str %> Thanks, Venkatesh. SCJP 1.4
Joined: Jan 30, 2002
Thanks Venkatesh, That makes sense. You know I always bracket my ifs anyway in pure Java code, I was just being lazy this time and it bit me.