org.apache.jasper.JasperException:处理 [/tag2.jsp] 时发生异常

标题

1.先贴出我的错误信息:

消息 在 [14] 行处理 [/tag2.jsp] 时发生异常

描述 服务器遇到一个意外的情况,阻止它完成请求。

Exception

org.apache.jasper.JasperException: 在 [14] 行处理 [/tag2.jsp] 时发生异常

11: 	<%
12: 		pageContext.setAttribute("age","18");
13: 	%>
14: 	
15: 	
16: 
17: 


Stacktrace:
	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:626)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:515)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
Root Cause

java.lang.NullPointerException
	tag.MyTag5.doTag(MyTag5.java:25)
	org.apache.jsp.tag2_jsp._jspx_meth_myTag_005fMyTag5_005f0(tag2_jsp.java:173)
	org.apache.jsp.tag2_jsp._jspService(tag2_jsp.java:137)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:477)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)

2.在网上搜了下没有找到和我一样的,于是我试着修改了下,发现当自定义的标签"MyTag5"和结束标签处于同一行是就会报错,只要换到下一行就行了~~;
即:


你可能感兴趣的:(java)