使用DisplayTag库发行问题

时间:2014-11-22 23:49:57

标签: displaytag

我正在尝试使用DisplayTag.jar在基于struts2的应用程序中显示数据表。我的构建路径上有displayTag-1.2.jar和commons-beanutils-1.8,但仍然在运行时我得到以下异常并显示空白页面:

23-nov-2014 0:42:58 org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet default threw exception
java.lang.ClassNotFoundException: org.apache.commons.beanutils.NestedNullException
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
    at org.displaytag.tags.TemplateTag.evaluateExpression(TemplateTag.java:84)
    at org.displaytag.tags.TableTag.initParameters(TableTag.java:932)
    at org.displaytag.tags.TableTag.doStartTag(TableTag.java:767)
    at org.apache.jsp.transactionsData_jsp._jspService(transactionsData_jsp.java:121)
    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:374)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
    at org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:139)
    at org.apache.struts2.dispatcher.StrutsResultSupport.execute(St

有人知道这是什么问题吗?

2 个答案:

答案 0 :(得分:0)

通过添加commons-beanutils-1.7解决。

答案 1 :(得分:0)

ClassNotFoundException occurs when java doesnt find class files in its classpath.
class files resides in jars, for this case org.apache.commons.beanutils.NestedNullException class is not found by the JVM,
Please download the jar from below link and add it to your build path.
http://commons.apache.org/proper/commons-beanutils/
thanks.