on 10-22-2009 7:17 AM
Hi,
in Netweaver 7.1 CE the method wdComponentAPI.getMessageManager().raiseException
is deprecated.
Question 1:
What should be used in instead? Javadoc says use ReportException in combination with a checked Exception. How should I use this?
Question 2:
Can I stop the execution of the application in wdDoInit of a Controller?
Best regards,
Peter
Hi Peter,
Question 1:
wdComponentAPI.getMessageManager().reportException(arg);
arg- may be String or Exception;
You can stop the navigation using this code.
wdComponentAPI.getMessageManager().cancelNavigation();
Question 2:
Yes, you can stop the execution of the application.
return;
Feel free to revert in case of issues.
Regards,
Siva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Peter,
Can I stop the execution of the application in wdDoInit of a Controller?
What do you exactly want?
Do you want to terminate the application or stop the execution of the method?
To stop the execution of the method, we can use return like this:
if (condition){
return;
}
We can terminate the application also using WDClientUser.forceLogoffClientUser(url);
Feel free to revert to in case of issues.
Regards,
Siva
Hello,
in the method tab you can add custom exceptions to your method, the caller of your method than needs to deal with the exception. Like this:
public void myMethod throws CustomException
try {
myMethod();
}
catch(CustomException e)
{ // well ****, here we are
wdComponentAPI.getMessageManager().reportException(e.getMessage());
}
finally {
// do what needs to be done
}
As for stopping the whole application, I think its a better solution to handle the error and stop code from being executed with if conditions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.