<% @ page language = "java" contentType = "text / html" pageEncoding = "UTF-8"%>
<%
response.getWrite (). write ("{name:'', age: 26, email: 'sss@eee.com'}");
%>
---------------------------------------------- ---------------------------------
An error has occurred. See error log for more details.
java.lang.NullPointerException
HTTP Status 500 -
--------
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: 4 in the jsp file: / person.jsp
The method getWrite () is undefined for the type HttpServletResponse
1: <% @ page language = "java" contentType = "text / html" pageEncoding = "UTF-8"%>
2:
3: <%
4: response.getWrite (). write ("{name:'', age: 26, email: 'sss@eee.com'}");
5:%>
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError (DefaultErrorHandler.java: 92)
org.apache.jasper.compiler.ErrorDispatcher.javacError (ErrorDispatcher.java: 330)
org.apache.jasper.compiler.JDTCompiler.generateClass (JDTCompiler.java: 423)
org.apache.jasper.compiler.Compiler.compile (Compiler.java: 317)
org.apache.jasper.compiler.Compiler.compile (Compiler.java: 295)
org.apache.jasper.compiler.Compiler.compile (Compiler.java: 282)
org.apache.jasper.JspCompilationContext.compile (JspCompilationContext.java: 586)
org.apache.jasper.servlet.JspServletWrapper.service (JspServletWrapper.java: 317)
org.apache.jasper.servlet.JspServlet.serviceJspFile (JspServlet.java: 342)
org.apache.jasper.servlet.JspServlet.service (JspServlet.java: 267)
javax.servlet.http.HttpServlet.service (HttpServlet.java: 717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.
------ Solution ------------------------------------ --------
<% out.print ("{name:'', age: 26, email: 'sss@eee.com'}");%>
------ Solution ------------------------------------------- -
response.getWrite (). this report is null so the anomaly .
------ Solution ---------------------------------------- ----
response object undeclared
------ Solution ---------------------------- ----------------
note
response.getWrite ()
and
response.getWriter ()
distinction @ @ @ @
------ Solution ------------------------------ --------------
response.getWrite () changed out
------ For reference only ------------- --------------------------
Thank you
没有评论:
发表评论