Gaet et al

Yes with ActionMessages you will be pulling key indexed locale specific Unicode strings
where locale detaults to your browsers locale
e.g.
(keyed information contained within ApplicationResources_fr_FR.properties will be extracted while
you are using a french browser in Paris)
Take a look at
http://javaboutique.internet.com/tutorials/excep_struts/index-3.html

Bon Chance,

Martin Gainty
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relating to the official business of Sender and is proprietary to Sender. It is confidential, legally privileged and protected by law. Sender does not own and endorse any other content.
(mobile) 001-617-852-7822





In 1.2.7 you simply change the ActionErrors to ActionMessages.  you still
save the errors with the saveErrors method and it works the same in the
tags.




             "Gaet"
             <[EMAIL PROTECTED]
             >                                                          To
                                       "Mailing List Struts"
             06/30/2005 04:54          <user@struts.apache.org>
             AM                                                         cc

                                                                   Subject
             Please respond to         Exception  - General Question
               "Struts Users
               Mailing List"
             <[EMAIL PROTECTED]
                  he.org>






Hi everybody,

Up to now, I was handling my exceptions in my Action class as follow :

----------------------------------------------------------------------------

----------------
    ActionErrors errors = new ActionErrors();
    try{
    ......
    ......

    } catch (Exception e) {
    //Put print stack trace in System.err so it is logged
    e.printStackTrace(System.err);
    //
    errors.add(ActionErrors.GLOBAL_ERROR, new
ActionMessage("errors.keyDescribingError : "+e.getMessage()));
    saveErrors(request, errors);
    // Forward control to the appropriate error page
    forward = mapping.findForward("erreur");
    }
----------------------------------------------------------------------------

----------------


However ActionErrors is now deprecated so I'm wondering if using
ActionMessages instead is well appropriate.????

I have seen that a common use is to define an ExceptionHandler....seems to
be nice as we just handke the errors in one place but :
- It seems that using ExceptionHandler we lost the finest degree of the
exception and we have not a personnalized message for the exception thrown.
       Of course, we could do a catch in the Action class and throw the
exception with the personalized messaged but then I have another question :
            - Does ExceptionHandler slower than catching the exception in
each Action class?

Finally, What is the best practice to handle exceptions in struts?

Thanks in advance for your help








---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to