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的那里面运行的.
<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的那里面运行的.
<%=i*i%>
<% } %>
</table>
<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>
这样该正确了吧可还是不行的啊
^ ^
注意不要加空格
<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>