-
1. Re: ejb3 exception
wdfink Jun 14, 2011 2:25 PM (in response to nskarthik_k)If you declare a checked Exception it will be provided to the client.
RuntimeExceptions might be covered.
Is that what you meant?
-
2. Re: ejb3 exception
nskarthik_k Jun 16, 2011 1:38 AM (in response to wdfink)Hi
My Primary requirement isto display appropriate message in Unicode languages for a single installation...this needs to be displayed Error / Exception Gentel messages raised on account of exceptions...
To achieve the same i have to customised the my own Exception class called "EjbException.java" which extends Exception calss
With this process I need the number raised due to Exception to return back to the Clinet . A Unique number for every exception's type is used as key value pair ..
The number is refrence to a Gentel Error message to the client User in appropriate Unicoded Fomat
English Users
1001 = Data Not Provided ( english )
or
Spanish User
1001 = xxxxxx( Spanish )
//Ejb's
try{
}catch(SQLException sqx){
throws new EjbException(1001)
}
//ejb3 client (web / standalone /.....)
int Error = xyz XXXXXXX("????") // this should fetch the 1001
String message = xyz.getMessage(Error); // this should fetch the appropriate message and display
with regards
karthik
-
3. Re: ejb3 exception
wdfink Jun 16, 2011 3:33 AM (in response to nskarthik_k)I use standard Java ResourceBundle for this, it support what you need.
The Exception include a key (in your case the number) and the native message.
The getMessage() or getLocalizedMessage() method checks the ResourceBundle and provide the localized message or the native one if nothing was found.