on 2006 Oct 20 12:08 PM
Hi all,
i have an exception handling problem in web dynpro. For my app (WEB AS 6.40 SP 15) i need an exception handler to catch all exceptions before the overall errorpage is shown (because there you cannot log, clean up resources and show an individual error messages to the user).
In case of such an exception handler i don´t have spread try/catch blocks all over the WD code to catch exceptions the app cannot recover from.
Does anyone has a suggestion whether a hook or something else exists in web dynpro (e.g. something like the error page mapping in a servlet container?)
Thanks for help
Christian
Hi,
As i know, we don't have any ready made solution, where all the errors can track. Instead you can create generic page(error page), redirect it to this page whenever you got any error.
To redirect to the error page u can create erroPlug and point it to that. In your catch block point to the errorpage whenever you got error.
Regards,
Sridhar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sridhar,
thanks for the reply but this only helps a bit because i don´t know which exception can be thrown at any piece of code. For example there are many unchecked exceptions where i do not need a catch and there are are many WebDynproExceptions too. For all these exceptions i do not know the place and time (at the phase model) where they occur so i have the need of one hook to catch all possible exceptions before the response goes to the user (in case of an unhandeled exception an predefined errorpage with or without the stacktrace).
Regards,
Christian
Hi,
Refer to the help link on 'Error Handling',
http://help.sap.com/saphelp_nw04/helpdata/en/d1/1937e802d4ef4597fa14c48e66ca5d/content.htm
Regards
Srinivasan T
I think thats not what he is after. The catch exception could be possible but where to put it? There isnt like a method which kicks of the whole application like a
public static void main(String[] args) for example.
Is there a handler or hook which is triggered when a non-caught exception is thrown?
regards,
Hugo
Hi Hugo,
that is exactly what i´m looking for
If you are building a desktop-app e.g. based on swing, you can use ThreadGruop.uncaughtException to handle ALL exceptions before the thread is closed by the VM.
If you are using a Servletcontainer you can configure an error-page which is mapped to a special exception e.g. Throwable. This error-page can be implemented as a normal servlet so you can do ALL of your necessary error handling there.
These are two ways to clean up resources and do some last logging in case an error occures the app cannot recover from.
Is there anything comparable in WebDynpro?
Regards,
Christian
User | Count |
---|---|
71 | |
10 | |
8 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.