我打开了一个如下所示的模式
Map<String, List<String>> paramMap = new HashMap<String, List<String>>();
Map<String, Object> options = new HashMap<String, Object>();
options.put("modal", true);
options.put("width", 650);
options.put("height", "100%");
options.put("closable", false);
options.put("draggable", false);
options.put("resizable", false);
options.put("contentWidth", 645);
options.put("contentHeight", "100%");
List<String> idValues = new ArrayList<String>();
idValues.add(idValue);
paramMap.put("id", idValues);
getRequestContext().openDialog("sampleModel", options, paramMap);
and the nagivation case for the model is as follows
<navigation-case>
<from-outcome>sampleModel</from-outcome>
<to-view-id>/sample/views/model/sampleModel.xhtml</to-view-id>
<redirect include-view-params="true" />
</navigation-case>
一切都按预期工作,但是当我尝试关闭以下模式时
RequestContext.getCurrentInstance().closeDialog("sampleModel");
上面的代码抛出异常 异常:java.lang.NullPointerException:参数错误:参数键为空
完整堆栈跟踪
21:22:33,401 ERROR [net.sample.jsf.controller.SampleModelController] (http-127.0.0.1/127.0.0.1:443-2) net.stafftrack.ui.web.recruiting.myrequisition.jsf.controller.SampleModelControllerinitialize : Exception: java.lang.NullPointerException: Argument Error: Parameter key is null
at com.sun.faces.util.Util.notNull(Util.java:325) [jsf-impl-2.1.27.redhat-8.jar:2.1.27.redhat-8]
at com.sun.faces.context.SessionMap.put(SessionMap.java:125) [jsf-impl-2.1.27.redhat-8.jar:2.1.27.redhat-8]
at com.sun.faces.context.SessionMap.put(SessionMap.java:61) [jsf-impl-2.1.27.redhat-8.jar:2.1.27.redhat-8]
at org.primefaces.context.DefaultRequestContext.closeDialog(DefaultRequestContext.java:231) [primefaces-6.2.26.jar:6.2.26]
at net.sample.jsf.controller.SampleModelController.initialize(SampleModelController.java:188) [classes:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_80]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_80]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_80]
at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_80]
at org.apache.el.parser.AstValue.invoke(AstValue.java:258) [jbossweb-7.3.1.Final-redhat-1.jar:7.3.1.Final-redhat-1]
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278) [jbossweb-7.3.1.Final-redhat-1.jar:7.3.1.Final-redhat-1]
at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40) [weld-core-1.1.17.Final-redhat-1.jar:1.1.17.Final-redhat-1]
at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50) [weld-core-1.1.17.Final-redhat-1.jar:1.1.17.Final-redhat-1]
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105) [jsf-impl-2.1.27.redhat-8.jar:2.1.27.redhat-8]
at com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87) [jsf-impl-2.1.27.redhat-8.jar:2.1.27.redhat-8]
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:101) [jsf-impl-2.1.27.redhat-8.jar:2.1.27.redhat-8]
at org.primefaces.application.DialogActionListener.processAction(DialogActionListener.java:46) [primefaces-6.2.26.jar:6.2.26]
at net.stafftrack.fw.ui.web.jsf.component.UIViewAction.broadcast(UIViewAction.java:692) [stafftrack_utility.jar:]
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:786) [jboss-jsf-api_2.1_spec-2.1.27.Final-redhat-1.jar:2.1.27.Final-redhat-1]
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1251) [jboss-jsf-api_2.1_spec-2.1.27.Final-redhat-1.jar:2.1.27.Final-redhat-1]
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) [jsf-impl-2.1.27.redhat-8.jar:2.1.27.redhat-8]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.1.27.redhat-8.jar:2.1.27.redhat-8]
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [jsf-impl-2.1.27.redhat-8.jar:2.1.27.redhat-8]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593) [jboss-jsf-api_2.1_spec-2.1.27.Final-redhat-1.jar:2.1.27.Final-redhat-1]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.3.1.Final-redhat-1.jar:7.3.1.Final-redhat-1]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.3.1.Final-redhat-1.jar:7.3.1.Final-redhat-1]
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:103) [primefaces-6.2.26.jar:6.2.26]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.3.1.Final-redhat-1.jar:7.3.1.Final-redhat-1]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.3.1.Final-redhat-1.jar:7.3.1.Final-redhat-1]
at net.stafftrack.ui.web.security.filter.StafftrackSecurityFilter.doFilter(StafftrackSecurityFilter.java:105) [classes:]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.3.1.Final-redhat-1.jar:7.3.1.Final-redhat-1]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.3.1.Final-redhat-1.jar:7.3.1.Final-redhat-1]
at net.stafftrack.ui.web.security.filter.SecurityFilter.processSTNRequest(SecurityFilter.java:137) [classes:]
at net.stafftrack.ui.web.security.filter.SecurityFilter.doFilter(SecurityFilter.java:57) [classes:]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.3.1.Final-redhat-1.jar:7.3.1.Final-redhat-1]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.3.1.Final-redhat-1.jar:7.3.1.Final-redhat-1]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) [jbossweb-7.3.1.Final-redhat-1.jar:7.3.1.Final-redhat-1]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.3.1.Final-redhat-1.jar:7.3.1.Final-redhat-1]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:407) [jbossweb-7.3.1.Final-redhat-1.jar:7.3.1.Final-redhat-1]
at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.3.2.Final-redhat-2.jar:7.3.2.Final-redhat-2]
at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.3.2.Final-redhat-2.jar:7.3.2.Final-redhat-2]
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.3.2.Final-redhat-2.jar:7.3.2.Final-redhat-2]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) [jbossweb-7.3.1.Final-redhat-1.jar:7.3.1.Final-redhat-1]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.3.1.Final-redhat-1.jar:7.3.1.Final-redhat-1]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.3.1.Final-redhat-1.jar:7.3.1.Final-redhat-1]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336) [jbossweb-7.3.1.Final-redhat-1.jar:7.3.1.Final-redhat-1]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) [jbossweb-7.3.1.Final-redhat-1.jar:7.3.1.Final-redhat-1]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.3.1.Final-redhat-1.jar:7.3.1.Final-redhat-1]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926) [jbossweb-7.3.1.Final-redhat-1.jar:7.3.1.Final-redhat-1]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_80]
有人可以帮忙解决此问题并从bean中关闭模式吗?
环境:JSF 2.2,PrimeFaces 6.2.2,Jboss 7.1