我正在尝试在我的项目中实现Datatables spring。
在RoleController.java
文件中
@Controller
public class RoleController {
@RequestMapping(value = "/masterRole")
public ModelAndView about() {
RoleDAO dao = new RoleDAOImpl();
List<Role> list = dao.list();
ModelAndView model = new ModelAndView();
model.addObject("list",list);
model.setViewName("roleTile");
return model;
}
}
在tiles.xml
文件中
<definition name="roleTile" extends="base.definition" >
<put-attribute name="title" value="DAM Role Master" />
<put-attribute name="body" value="/WEB-INF/pages/viewRole.jsp" />
<put-attribute name="menuselection" value="master" />
</definition>
在viewRole.jsp
文件中
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="datatables" uri="http://github.com/dandelion/datatables" %>
<datatables:table id="roles" data="${list}" row="role" cssClass="table table-striped">
<datatables:column title="Id">
<c:out value="${role.roleId}"></c:out>
</datatables:column>
<datatables:column title="Role">
<c:out value="${role.role}"></c:out>
</datatables:column>
</datatables:table>
我收到以下错误
java.lang.NullPointerException at com.github.dandelion.datatables.core.configuration.ConfigurationStore.getPrototype(ConfigurationStore.java:82) at com.github.dandelion.datatables.core.configuration.TableConfiguration.getInstance(TableConfiguration.java:117 ) 在 com.github.dandelion.datatables.core.html.HtmlTable.(HtmlTable.java:76) 在 com.github.dandelion.datatables.jsp.tag.TableTag.doStartTag(TableTag.java:91) 在 org.apache .jsp.WEB_002dINF.pages.viewRole_jsp._jspService(viewRole_jsp.java:78) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java :803) 在 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337) 在 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374) 在 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266) 在 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 290) 在 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 在 org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630) 在 org.apache.catalina.core.ApplicationDispatcher .doInclude(ApplicationDispatcher.java:535) 在 org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472) 在 org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968) 在 org. org.apache.jasper.runtime.PageContextImpl 中的 apache.jasper.runtime.PageContextImpl.doInclude(PageContextImpl.java:638)。include(PageContextImpl.java:632) at org.apache.tiles.request.jsp.JspRequest.doInclude(JspRequest.java:123) at org.apache.tiles.request.AbstractViewRequest.dispatch(AbstractViewRequest.java:47) at org .apache.tiles.request.render.DispatchRenderer.render(DispatchRenderer.java:47) 在 org.apache.tiles.request.render.ChainedDelegateRenderer.render(ChainedDelegateRenderer.java:68) 在 org.apache.tiles.impl.BasicTilesContainer .render(BasicTilesContainer.java:259) 在 org.apache.tiles.template.InsertAttributeModel.renderAttribute(InsertAttributeModel.java:188) 在 org.apache.tiles.template.InsertAttributeModel.execute(InsertAttributeModel.java:132) 在 org. org.apache.jsp.WEB_002dINF.pages.layout_jsp 中的 apache.tiles.jsp.taglib.InsertAttributeTag.doTag(InsertAttributeTag.java:299)。_jspx_meth_tiles_005finsertAttribute_005f4(layout_jsp.java:222) at org.apache.jsp.WEB_002dINF.pages.layout_jsp._jspService(layout_jsp.java:95) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax .servlet.http.HttpServlet.service(HttpServlet.java:803) 在 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374) 在 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java :337) 在 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 在 org.apache.catalina.core.ApplicationFilterChain。 internalDoFilter(ApplicationFilterChain.java:290) 在 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 在 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) 在 org.apache.tiles.request.servlet.ServletRequest.forward(ServletRequest.java:265) 在 org.apache.tiles.request.servlet.ServletRequest .doForward(ServletRequest.java:228) 在 org.apache.tiles.request.AbstractClientRequest.dispatch(AbstractClientRequest.java:57) 在 org.apache.tiles.request.render.DispatchRenderer.render(DispatchRenderer.java:47) 在org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:259) 在 org.apache.tiles.impl。BasicTilesContainer.render(BasicTilesContainer.java:397) at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:238) at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:221) at org .apache.tiles.renderer.DefinitionRenderer.render(DefinitionRenderer.java:59) 在 org.springframework.web.servlet.view.tiles3.TilesView.renderMergedOutputModel(TilesView.java:114) 在 org.springframework.web.servlet.view .AbstractView.render(AbstractView.java:267) 在 org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1221) 在 org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1005) 在org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:952) 在 org.springframework.web。servlet.DispatcherServlet.doService(DispatcherServlet.java:870) 在 org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) 在 org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)在 javax.servlet.http.HttpServlet.service(HttpServlet.java:690) 在 org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java :803) 在 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 在 org.springframework.security.web 的 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)。 FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) 在 org.springframework.security.web.access。org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter( FilterChainProxy.java:342) 在 org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113) 在 org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) 在 org .springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103) 在 org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) 在 org.springframework.security.web.authentication .AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter. java:146) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154) at org.springframework .security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) 在 org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150) 在 org.springframework.security.web。 FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy. java:342) at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org .springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:85) 在 org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) 在 org.springframework.security.web.FilterChainProxy$VirtualFilterChain。 doFilter(FilterChainProxy.java:342) at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:57) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org .springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) at org.springframework.security.web.FilterChainProxy $虚拟过滤器链。doFilter(FilterChainProxy.java:342) at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160) at org.springframework .web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344) 在 org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261) 在 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java :235) 在 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) 在 org.apache.catalina.core 的 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)。 org.apache 上的 StandardContextValve.invoke(StandardContextValve.java:175)。catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java: 109) 在 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) 在 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) 在 org.apache.coyote.http11.Http11Protocol $Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:744)调用(StandardEngineValve.java:109)在 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)在 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)在 org.apache .coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread .java:744)调用(StandardEngineValve.java:109)在 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)在 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)在 org.apache .coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread .java:744)运行(Thread.java:744)运行(Thread.java:744)
我是数据表的新手。请帮我。
还邀请了 Datatbles 与 Spring 4 与休眠和磁贴的逐步集成的链接。