What's your page code look like?

On 9/8/06, Alexandre Jaquet <[EMAIL PROTECTED]> wrote:
Hi,

When I've some error, the error message is displayed two times with my
code :

example :

 if (validateAction() == false)
    UtilGui.setJSFErrorMessage("action_null", new Exception());

 public static void setJSFErrorMessage(String errorIdFromBundle,
Exception fromEx) {
        if (errorIdFromBundle == null ||
errorIdFromBundle.trim().length() == 0) {
            ec.handleError("Invalid ERROR ID", ErrorLevel.FATAL);
        }
        FacesContext context = FacesContext.getCurrentInstance();
        ResourceBundle myRessourceBundle =
ResourceBundle.getBundle("Errors", context.getViewRoot().getLocale());
        String myTranslatedString;
        try {
            myTranslatedString =
myRessourceBundle.getString(errorIdFromBundle);
        } catch (MissingResourceException ex) {
            myTranslatedString = "[missing key '" + errorIdFromBundle +
"' in properties file]";
        }
        context.addMessage(null, new FacesMessage(myTranslatedString));
        if (UtilGui.DEBUG_MODE && fromEx != null) {
            context.addMessage(null, new FacesMessage(fromEx.getMessage()));
            fromEx.printStackTrace();
        }
    }
any idea how to fix it ?

my best regards

Reply via email to