Sum of 1 to 100
<% int total = 0;
for (int cnt = 1; cnt <= 100; cnt++)
total +=cnt;
%>
1 + 2 + 3 + ... + 100 = <% = total %>
이렇게 따라 했는데 오류 메시지가 나옵니다.
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 11 in the jsp file: /Hundred.jsp
Syntax error on token "=", @ expected
8: for (int cnt = 1; cnt <= 100; cnt++)
9: total +=cnt;
10: %>
11: 1 + 2 + 3 + ... + 100 = <% =total %>
12: