Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

what is the most better way to handle return value from ejb?

  Asked By: Fabiana    Date: Mar 03    Category: Java    Views: 771
  

I want to know if we have a client user how wans to do an action for
example insert new user and in ejb layer (i mean bean layer) we found
it has not permition to do it. Is it better to throw new custom
exception or set a return value to show it?

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Code Guru     Answered On: Mar 03

If the intention of the method is to verify and validate a user  you can return  a value with possible propagation of security context, otherwise if the intention is to control the secure access to a method and guarantee that the method is access by privileged user, you should throw an application exception. this is to comply with design strategies.

Refer to business-tier design strategies and best practices.

 




Tagged: