javascript
jsp 嵌入java_关于JSP里的Java语句嵌入问题
是這樣的,我用的是Intellij 導(dǎo)入了一個(gè)MyEclipse的包(該包已部署在服務(wù)器上,所以是沒(méi)有大錯(cuò)誤的)。
然后在一個(gè)jsp文件出現(xiàn)了個(gè)問(wèn)題:
莫名奇妙地println變成了紅色,執(zhí)行的時(shí)候就直接拋出異常了。
今天剛接觸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 + "涓墜鏈哄彿鐮侊細(xì)
");
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)
總結(jié)
以上是生活随笔為你收集整理的jsp 嵌入java_关于JSP里的Java语句嵌入问题的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Java Formatter forma
- 下一篇: mysql手动安装配置,mysql8.0