Servlet.service() for servlet jsp threw exception,NullPointerException

woshichu66 2012-09-20 10:04:29
部分异常如下:
2012-9-20 9:57:40 org.apache.catalina.core.ApplicationDispatcher invoke
严重: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:49)
at org.apache.jsp.jsp.head_jsp._jspx_meth_s_005fselect_005f0(head_jsp.java:181)
at org.apache.jsp.jsp.head_jsp._jspService(head_jsp.java:137)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

我在页面引入了struts2的标签库,然后在页面使用strus2标签,但是每次都提示空指针异常(任何struts2标签都报异常),但是在其他页面使用ok没有这个问题,不知道错在哪里,请高人解答。
页面代码如下:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'add.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
</head>

<body>
<table width="100%">
<tr>
<td>
<div id="pageWrap">
<div id="pageBody">
<s:select list="#{1:'男',0:'女',2:'renyao'}"></s:select>
</div>
</div>
</td>
</tr>
</table>
</body>
</html>
...全文
97 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
woshichu66 2012-09-20
  • 打赏
  • 举报
回复
希望高手解释,谢谢。
woshichu66 2012-09-20
  • 打赏
  • 举报
回复
希望高手解释,谢谢。
woshichu66 2012-09-20
  • 打赏
  • 举报
回复
希望高手解释,谢谢。
liu4626846 2012-09-20
  • 打赏
  • 举报
回复
同求! ++ 1

50,527

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧