更改列表的顺序后,删除不起作用

时间:2013-11-22 18:37:51

标签: java-ee javabeans stripes

我正在使用Stripes编写一个javaEE应用程序[1]。

我有我的bean类VisitActionBean [2],默认处理程序是方法列表131 @ [2],它将对象visits分配给存储在db中的所有访问。此外,我已经实现了另外两个Resolutions方法140-153 @ [2] eassigning变量visits(更改顺序),然​​后将其转发到与默认处理程序相同的页面[3]。按钮17-24 @ [3]调用这两个方法,并成功更改列表项的顺序。但在更改订单后,我的删除按钮不起作用40-43 @ [3](删除工作没有问题,如果我不使用我的排序按钮),apache tomcat显示:

18:23:11.061 [http-bio-8080-exec-43] ERROR n.s.s.e.DefaultExceptionHandler - Unhandled exception in exception handler.
java.lang.NullPointerException: null
    at cz.muni.fi.pa165.webapp.VisitActionBean.delete(VisitActionBean.java:189) ~[VisitActionBean.class:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_45]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_45]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_45]
    at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_45]
    at net.sourceforge.stripes.controller.DispatcherHelper$6.intercept(DispatcherHelper.java:456) ~[stripes-1.5.7.jar:1.5.7]
    at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:158) ~[stripes-1.5.7.jar:1.5.7]
    at net.sourceforge.stripes.controller.BeforeAfterMethodInterceptor.intercept(BeforeAfterMethodInterceptor.java:113) ~[stripes-1.5.7.jar:1.5.7]
    at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155) ~[stripes-1.5.7.jar:1.5.7]
    at net.sourceforge.stripes.controller.ExecutionContext.wrap(ExecutionContext.java:74) ~[stripes-1.5.7.jar:1.5.7]
    at net.sourceforge.stripes.controller.DispatcherHelper.invokeEventHandler(DispatcherHelper.java:454) ~[stripes-1.5.7.jar:1.5.7]
    at net.sourceforge.stripes.controller.DispatcherServlet.invokeEventHandler(DispatcherServlet.java:278) ~[stripes-1.5.7.jar:1.5.7]
    at net.sourceforge.stripes.controller.DispatcherServlet.service(DispatcherServlet.java:160) ~[stripes-1.5.7.jar:1.5.7]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) ~[servlet-api.jar:na]
    at net.sourceforge.stripes.controller.DynamicMappingFilter$2.doFilter(DynamicMappingFilter.java:431) ~[stripes-1.5.7.jar:1.5.7]
    at net.sourceforge.stripes.controller.StripesFilter.doFilter(StripesFilter.java:260) ~[stripes-1.5.7.jar:1.5.7]
    at net.sourceforge.stripes.controller.DynamicMappingFilter.doFilter(DynamicMappingFilter.java:418) [stripes-1.5.7.jar:1.5.7]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) [catalina.jar:7.0.34]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [catalina.jar:7.0.34]
    at cz.muni.fi.pa165.webapp.filter.EncodingFilter.doFilter(EncodingFilter.java:37) [EncodingFilter.class:na]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) [catalina.jar:7.0.34]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [catalina.jar:7.0.34]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) [catalina.jar:7.0.34]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) [catalina.jar:7.0.34]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) [catalina.jar:7.0.34]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) [catalina.jar:7.0.34]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) [catalina.jar:7.0.34]
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936) [catalina.jar:7.0.34]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) [catalina.jar:7.0.34]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) [catalina.jar:7.0.34]
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004) [tomcat-coyote.jar:7.0.34]
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) [tomcat-coyote.jar:7.0.34]
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312) [tomcat-coyote.jar:7.0.34]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_45]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_45]
    at java.lang.Thread.run(Thread.java:744) [na:1.7.0_45]

[1] https://github.com/rkuska/pa165-mushrooms/tree/5f24cf36d8edd5c1fabd9c0a1b88ed7220d33edd

[2] https://github.com/rkuska/pa165-mushrooms/tree/5f24cf36d8edd5c1fabd9c0a1b88ed7220d33edd/MushroomPortal/WebApp/src/main/java/cz/muni/fi/pa165/webapp/VisitActionBean.java

[3] https://github.com/rkuska/pa165-mushrooms/tree/5f24cf36d8edd5c1fabd9c0a1b88ed7220d33edd/MushroomPortal/WebApp/src/main/webapp/visit/list.jsp

1 个答案:

答案 0 :(得分:0)

好的,我想通了,我刚刚提交了[1]修复,将隐藏更改为param。

[1] https://github.com/rkuska/pa165-mushrooms/commit/202c4912b779be4a06f329fa73f88b9b3f5d0c00