tomcat和JSDK都装上去了.为什么运行不了.
<html>
<head><title> my_first_jsp_program </title></head><body>
<center> <h2> my_first_jsp_program </h2></center>
<table border="2" align="center"><th> 原数 </th> <th> 结果 </th>
    <% for (int i=0;i<10;i++)
       {%>
<tr><td> <% =i %> </td>
<td> <% = i*i %> </td>
<tr>
    <%}
</table>
</body>
</html>
上面的语法错了这才是真正的但还是没有执行FOR
http://localhost:7070/myjsp/jsp.jsp我是在tomcat的那里面运行的.

解决方案 »

  1.   

    <%=i%>
    <%=i*i%>
      

  2.   

    <tr>
        <% } %>
    </table>
      

  3.   

    purejd + bestdelphier =正确答案
      

  4.   

    <html>
    <head><title> my_first_jsp_program </title></head><body>
    <center> <h2> my_first_jsp_program </h2></center>
    <table border="2" align="center"><th> 原数 </th> <th> 结果 </th>
        <% for (int i=0;i<10;i++){%>
    <tr><td> <% =i %> </td>
    <td> <% = i*i %> </td>
    </tr>
        <%}%>
    </table>
    </body>
    </html>
    这样该正确了吧可还是不行的啊
      

  5.   

    <% =i %>    <% = i*i %>
      ^           ^
    注意不要加空格
      

  6.   

    <%@ page contentType="text/html; charset=GBK" %>
    <html>
    <head><title> my_first_jsp_program </title></head><body>
    <center> <h2> my_first_jsp_program </h2></center>
    <table border="2" align="center"><th> 原数 </th> <th> 结果 </th>
        <% for (int i=0;i<10;i++){%>
    <tr><td> <%=i %> </td>
    <td> <%= i*i %> </td>
    </tr>
        <%}%>
    </table>
    </body>
    </html>