获得从Java(Apache Tomcat的)后端堆栈跟踪Flex的前端(由BlazeDS的连接)堆栈、后端、Apache、Java

2023-09-08 14:16:08 作者:长虹饮涧

我使用BlazeDS的,以我的Flex前端连接到我的Java后端,并想知道是否有什么办法可以在发生异常的完整堆栈跟踪传递到前端。当我设置在Flex中的异常处理程序一个破发点,我刚才看到一个基本的信息,故障字符串等。

I'm using BlazeDS to connect my Flex front end to my Java backend, and was wondering if there is any way I can get the complete stack trace in case of an exception to be passed to the front end. When I set a break point in the exception handler in Flex, I just see a basic message, fault string etc.

请问AP preciate任何帮助。

Would appreciate any help.

谢谢!

推荐答案

您可以创建一个自定义异常;再搭上在最高级别的所有服务器端的异常,并与原来的异常作为一个属性的堆栈跟踪再次抛出您的自定义异常。您应该能够访问此客户方。

You could create a custom exception; then catch all serverside exceptions at highest level and rethrow your custom exception with the stacktrace of the original exception as a property. You should be able to access this clientside.

另外,如果你使用Spring的服务器端,如何使用Spring BlazeDS集成能使用翻译服务器端异常到更清洁的客户端的人除了翻译。

Also, if you're using Spring on the server side, the Spring BlazeDS integration can translate server-side exceptions into cleaner client-side ones using exception translators.