原代码
<html>
<head><title>Powers of 2</title></head>
<body>
<center>
<h2>Behold The Powers Of 2</h2>
</center>
<table border="2" align="center">
<th>Exponent</th><th>2'Exponent</th>
<% for(int i=0;i<10;i++){ %>
<tr><td><% =i %></td> <td><% =Math.pow(2,i) %></td>
</tr>
<% } %>
</table>
</body>
</html>
错误信息
HTTP Status 500 - --------------------------------------------------------------------------------type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.apache.jasper.JasperException: Unable to compile class for JSPAn error occurred at line: 11 in the jsp file: /PowerOf2.jspGenerated servlet error:
    [javac] Compiling 1 source fileD:\TOOLS\tomcat50-jwsdp\work\Catalina\localhost\test\org\apache\jsp\PowerOf2_jsp.java:57: illegal start of expression
 =i 
 ^An error occurred at line: 11 in the jsp file: /PowerOf2.jspGenerated servlet error:
D:\TOOLS\tomcat50-jwsdp\work\Catalina\localhost\test\org\apache\jsp\PowerOf2_jsp.java:59: illegal start of expression
 =Math.pow(2,i) 
 ^
2 errors
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:82)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:306)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:373)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:416)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:397)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:507)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:258)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:205)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
note The full stack trace of the root cause is available in the Tomcat logs.
--------------------------------------------------------------------------------Sun-Java-System/Web-Services-Pack-1.4