What is the output of the following code? <HTML> <HEAD></HEAD> <BODY> <%! int counter; %> <% counter = 100; %> The number of hits <% = ++counter %> </BODY> </HTML> /*********** The code will not compile since there is a space in the expression is not valid Should it be like this...??? The number of hits <%=++counter%> ***********/
Clark Bruce
Greenhorn
Joined: Feb 27, 2002
Posts: 17
posted
0
Shan, There can be no space between the % and the = . It must be <%= expression %>. Regards, Clark
Anthony Villanueva
Ranch Hand
Joined: Mar 22, 2002
Posts: 1055
posted
0
Hi, Try this link for more information on expressions. -anthony [ March 26, 2002: Message edited by: Anthony Villanueva ]
tony lee
Ranch Hand
Joined: Jan 21, 2002
Posts: 52
posted
0
hi, i tried the code on tomcat4.1 after removed the space between % and =. it printed: The number of hits 101 /*********** "/*********** " is outside of the body. why it still can show up? tony