1. The
web interface and EJBs security works but when I try to use a restricted a
EJB method I only get a remoteException (I know... itґs normal). Is there some
way to control if this exception is caused by a Security Constraint ? (To show
for example... "Youґre not allowed to do that").
You
probably need to derive all you exceptions from RemoteException, and work with
these exceptions as usually, for example:
public class WrongUserException extends RemoteException
{
public WrongUserException {
}
...
}
Then
you code will look like:
public class SomeClass {
public void SomeMethod {
try {
// Invoke some secure
method..
MyEJB ejb =
someBean.someSecureMethod();
}
catch( WrongUserException e )
{
// Wrong
User!
}
catch( RemoteException )
{
// Something else has
happened!
}
}
}
HTH,
Sergei.
|
- MORE THAN ONE USER PROBLEM David Bonilla
- Sergei Batiuk