"
是这样的,我用的是Intellij 导入了一个MyEclipse的包(该包已部署在服务器上,所以是没有大错误的)。
然后在一个jsp文件出现了个问题:
莫名奇妙地println变成了红色,执行的时候就直接抛出异常了。
今天刚接触JavaWeb不太懂,到底是怎么回事呢?
异常:
type Exception report
message An exception occurred processing JSP page /blackphones.jsp at line 15
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: An exception occurred processing JSP page /blackphones.jsp at line 15
12: <%
13: String [] phones = (String []) request.getAttribute("blackphones");
14:
15: out.println("褰撳墠鏈� + phones.length + "涓墜鏈哄彿鐮侊細<br/><br/>");
16:
17: for(String phone : phones){
18: out.println(phone + " ");
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:575)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:477)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
com.aspire.mmlite.server.servlet.LogFilter.doFilter(LogFilter.java:63)
root cause
java.lang.NullPointerException
org.apache.jsp.blackphones_jsp._jspService(blackphones_jsp.java:96)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:439)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
com.aspire.mmlite.server.servlet.LogFilter.doFilter(LogFilter.java:63)
" ![image.png](https://ucc.alicdn.com/pic/developer-ecology/173a5cf3a91146c0b36e7108a7cfb9a6.png)
字符串数组没有实例化一个大小给它~length属性是空的
######鼠标移动到红色代码上看看提示什么?
![image.png](https://ucc.alicdn.com/pic/developer-ecology/2c0a541690db48eaa1b5b349d1891264.png)版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。