有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

JSR168中的java句柄PortletException

如何捕获和处理GenericPortlet引发的PortletException。doView()?如果由于某种原因引发此异常,我希望在JBoss portal中显示一个自定义错误页面或自定义消息


共 (1) 个答案

  1. # 1 楼答案

    Portlet 2.0规范(JSR 286——但我怀疑他们没有错误处理)说:

    It is left to the portal/portlet-container implementation how to react when a portlet throws an exception while processing a request. For example, the portal/portlet-container could render an error page instead of the portal page, render an error message in the portlet 25 window of the portlet that threw the exception or remove the portlet from the portal page and log an error message for the administrator.

    JBoss Portal's error handling似乎没有提供你想要的

    您可能需要自己处理这个问题,可能需要定义一个抽象基类,其他Portlet可以扩展这个抽象基类