大家帮我看看呀,我的JDK1.5和TOMCAT5.5都配置好了,服务器正常,但是下面的程序不能运行,哪里错了。 <% @ page contentType="text/html;charset=gb2312" %> <html> <head> <title>dayingbiaoge</title> </head> <body> <table border="2" width="50%"> <% for(int i=0;i<5;i++) {%> <tr> <% for(int j=0;j<5;j++){%> <td><%=i+j%></td> <%}%> </tr> <%}%> </table> </body> </html>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: 1 in the jsp file: /Demo.jsp Generated servlet error: Syntax error on token "contentType", VariableDeclaratorId expected after this tokenAn error occurred at line: 1 in the jsp file: /Demo.jsp Generated servlet error: Syntax error, insert ";" to complete LocalVariableDeclarationStatement
<% @ page contentType="text/html;charset=gb2312" %>
<html>
<head>
<title>dayingbiaoge</title>
</head>
<body>
<table border="2" width="50%">
<% for(int i=0;i<5;i++) {%>
<tr>
<% for(int j=0;j<5;j++){%>
<td><%=i+j%></td>
<%}%>
</tr>
<%}%>
</table>
</body>
</html>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: 1 in the jsp file: /Demo.jsp
Generated servlet error:
Syntax error on token "contentType", VariableDeclaratorId expected after this tokenAn error occurred at line: 1 in the jsp file: /Demo.jsp
Generated servlet error:
Syntax error, insert ";" to complete LocalVariableDeclarationStatement
告诉你一个铁定可以解决问题的办法,你先将jsp弄得最简单,比如就输出一个123,然后慢慢找是哪个地方出错了,有经验的人都是这样做错误的。
而且是要访问路径要相同,统一哦!
看错误提示,主要原因是这个
现在的错误是500,内部服务器错误.
你把你的这个my.jsp页面放到webapps/ROOT/my.jsp,肯定ok拉.
或者webapps/你的应用文件夹/my.jsp