English 中文(简体)
JSF: mis Hand with <error-page> and JSF1073
原标题:JSF: error handling with <error-page> and JSF1073 error

我的指令是error-page,把所有例外改为错误显示页码。

www.xml:

<web-app [...]>
    [...]
    <error-page>
        <exception-type>java.lang.Exception</exception-type>
        <location>/view/error.xhtml</location>
    </error-page>
</web-app>

www.un.org/spanish/ecosoc 它几乎没有任何例外:,但今天,我注意到,有时和共同财产基金有错误,没有处理例外(即没有改用错误页)。

Here what I have in the log:

javax.enterprise.resource.webcontainer.jsf.context || JSF1073: javax.faces.event.AbortProcessingException caught during processing of INVOKE_APPLICATION 5 : UIComponent-ClientId=searchForm:j_idt147, Message=/view/listView.xhtml @217,7 actionListener="#{listController.nextPageClicked}": java.lang.NullPointerException
javax.enterprise.resource.webcontainer.jsf.context || /view/listView.xhtml @217,7 actionListener="#{listController.nextPageClicked}": java.lang.NullPointerException
javax.faces.event.AbortProcessingException: /view/listView.xhtml @217,7 actionListener="#{listController.nextPageClicked}": java.lang.NullPointerException
    at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:182)
    at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
    at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:769)
    at javax.faces.component.UICommand.broadcast(UICommand.java:300)
    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
    at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
    at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
    at org.apache.catalina.core.StandardPipeline.doChainInvoke(StandardPipeline.java:600)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:96)
    at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.NullPointerException
    at ch.ethz.id.wai.web.controller.ListController.nextPageClicked(ListController.java:410)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)

我如何也处理这些例外情况?

<><><>>>><>>>>><>>>>><>>><>>>>>> 我并不表示,我想纠正造成例外的问题(这是另一个议题),但我的问题是,我如何能够将联合论坛的例外情况与<编码>和代版”;指令。 可以看到一个错误的页数,很容易错失该记录中的条目。

最佳回答

这是按设计的。 缩略语 这种方法将造成一种例外,只能被拖拉,而不是被抛弃。 它是“公正”的听众,他们打算从事细微的预处理/log化工作,而不是真正的行动。 只有当“<条码>>行动>”方法出现例外情况时,才将其所有方式下放给集装箱,并在违约页上结束。

If you want to perform exception-sensitive business actions, do it in the action method instead.

See also:

问题回答

暂无回答




相关问题
Separating Business Layer Errors from API errors

The title is horrible, i know; I m terrible at titles on SO here. I m wondering what would be the best way to present unified error responses in a webapi when errors could be raised deep inside the ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

How to tell why a file deletion fails in Java?

File file = new File(path); if (!file.delete()) { throw new IOException( "Failed to delete the file because: " + getReasonForFileDeletionFailureInPlainEnglish(file)); } Is there a ...

Exceptions: redirect or render?

I m trying to standardize the way I handle exceptions in my web application (homemade framework) but I m not certain of the "correct" way to handle various situations. I m wondering if there is a ...

热门标签