java - 在 JSR-168 中处理 PortletException

标签 java exception jboss portlet

如何捕捉和处理 GenericPortlet.doView() 抛出的 PortletException?如果由于某种原因抛出此异常,我想在 JBoss 门户中显示自定义错误页面或自定义消息。

最佳答案

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 可以扩展的抽象基类。

关于java - 在 JSR-168 中处理 PortletException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2160764/

相关文章:

JBoss EAP 6 环境变量 : standalone vs. 域

java - 尝试从插件内部获取 Maven 的版本

java - 如何删除主线程中手动创建的暂停?

java - 给定类型的动态变量

java - 从 onClickListener 内部处理深度异常

C++/WIndows - 无法捕获异常

java - GWT - 无法使用 UncaughtExceptionHandler 捕获 StatusCodeException

maven - 由于处理结构时出现故障,无法在 WildFly 8 上部署 Ear

java - 如何利用可选的 lambda 表达式

jboss - 将WAR文件部署到在JBOSS AS 7.1下工作的Jboss EAP 6.0时出错