初学JSP 遇到疑难问题
我在 html里嵌入了一段代码 显示时间和 IP 的
<html>
<head>
<title>ddd</title>
<body>
<td colspan="2" rowspan="2" valign="top">parent ID adr:</td>
<td rowspan="2" vaglign="top"><%= request.getRemote.Addr() %></td>
<td rowspan="2" vaglign="top"><%= request.getRemote.Addr() %></td><td>rowspan="2".vaglign="stop">
now time:</td>
<td rowspan="2" vaglign="top"><%= new java.util.Date() %></td>
</body>
</html>
结果就出现了下面段话
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 6 in the jsp file: /jsp/test.jsp
Generated servlet error:
request.getRemote cannot be resolved or is not a field
An error occurred at line: 7 in the jsp file: /jsp/test.jsp
Generated servlet error:
request.getRemote cannot be resolved or is not a field
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 6 in the jsp file: /jsp/test.jsp
Generated servlet error:
request.getRemote cannot be resolved or is not a field
An error occurred at line: 7 in the jsp file: /jsp/test.jsp
Generated servlet error:
request.getRemote cannot be resolved or is not a field
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:414)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:297)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
请问why & how to? thx
[解决办法]
<%= request.getRemote.Addr() % >
写错了吧,应该是
<%= request.getRemoteAddr() % >
[解决办法]
你不会是文本编辑写的吧?
用工具一般不会出现这样的错误
[解决办法]
来玩一步!也给分点分吧!以后得小心呀!
[解决办法]
<%= request.getRemoteAddr() % >
[解决办法]
<%@ page language="java" contentType="text/html; charset=gb2312"%>
最上面要写上这一句
我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.myexception.cn/java-web/317.html
我的异常网推荐解决方案:org.apache.jasper.JasperException: Unable to compile class,http://www.myexception.cn/j2ee/2308.html