milindd (1) [Avatar] Offline
#1
Hi

Is it possible to return a value using before advise.

Here is my example,

in my classes before any execution, I need to call a authenticate class and if that class retuns a true or false, depending on that decide whether to go ahead with furthur execution or return (eg. struts) mapping.findForward("failure")

What is the way I can do this,

I have tried everything nothing works as of now,

Regards
Milind.
ramnivas (171) [Avatar] Offline
#2
Re: return a value using before advise
Hi Milind,

Sorry for late reply. This message just skipped my attention in a pile of emails.

You have to use an around advice to implement this functionality.

Object around() : <pointcut> {
if(autheticated()) {
return proceed();
}
mapping.findForward("failure");
return null; // or status
}