indeed, when handling an AppException, instead of creating a new ActionError(key) with the key defined in the config and no args, the ExceptionHandler gets the ActionError from the AppException. This way, you can throw exceptions that build their own ActionError, using the ActionError(key, args) constructor ...
A simple example, imagine you want to throw an InvalidLoginException(login) that has a 'login' property. If InvalidLoginException extends AppException, you can pass the 'login' property to the ActionError constructor, which is not possible with the fully-declarative way. So the 'login' property can be used to build an more customized error message in your jsp handling this error ... It's just a very simple example of what could be done ... > -----Original Message----- > From: David Graham [mailto:[EMAIL PROTECTED]] > Sent: mercredi 2 octobre 2002 16:52 > To: [EMAIL PROTECTED] > Subject: RE: org.apache.struts.util.AppException implementing an > Interface > > > I don't understand the use of AppException in the first place. > Looking at > the code for ExceptionHandler, there is a check to see if the > exception is > an AppException but other types of Exceptions are handled in a > similar way. > It's not clear to me why I should subclass AppException when my business > classes should be isolated from all Struts classes. > > Can anyone explain why I would want to use AppException? > > Dave > > > >From: "phpsurf" <[EMAIL PROTECTED]> > >Reply-To: "Struts Developers List" <[EMAIL PROTECTED]> > >To: "Struts Developers List" <[EMAIL PROTECTED]> > >Subject: RE: org.apache.struts.util.AppException implementing an > Interface > >Date: Wed, 2 Oct 2002 11:15:19 +0200 > > > >indeed, I did not pay a real attention to the name of the interface ! :) > >suggest anything you like and it will be great ! > >and what did you thnik of the opportunity to have an interface > instead of a > >class for exceptions ? > > > > > > > -----Original Message----- > > > From: David Graham [mailto:[EMAIL PROTECTED]] > > > Sent: mardi 1 octobre 2002 20:23 > > > To: [EMAIL PROTECTED] > > > Subject: Re: org.apache.struts.util.AppException implementing an > > > Interface > > > > > > > > > I don't think adding interfaces using hungarian notation ("I" > > > prefix) is a > > > very good idea. It decreases readability and makes the name > >nonsensical. > > > It's especially not a good idea when none of the other > interfaces used > >in > > > struts have that notation. > > > > > > Dave > > > > > > > > > >From: "phpsurf" <[EMAIL PROTECTED]> > > > >Reply-To: "Struts Developers List" <[EMAIL PROTECTED]> > > > >To: "Struts Developers List" <[EMAIL PROTECTED]> > > > >CC: <[EMAIL PROTECTED]> > > > >Subject: org.apache.struts.util.AppException implementing an > Interface > > > >Date: Tue, 1 Oct 2002 20:10:35 +0200 > > > > > > > >Well, that was a very smart suggestion ! > > > >So, what about creating this interface ? > > > > > > > >- this interface could be called org.apache.struts.util.IAppException > > > >- this interface would declare 2 methods: getError() and > getProperty(). > > > >- this interface would be used by the default exception handler to > > > >recognize > > > >exceptions that carry an ActionError. > > > >- the AppException class would of course implement this interface. > > > > > > > >I would also suggest that an Exception can carry more than one > > > ActionError: > > > >either an ActionErrors instance or an HashMap of ActionError > > > instances ... > > > >Then we could have one more method in the IAppException: getErrors() > > > > > > > >Any idea about that ? > > > >I can prepare a patch if someone is interested ... > > > > > > > > > -----Original Message----- > > > > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > > > > > Sent: vendredi 20 septembre 2002 16:27 > > > > > To: [EMAIL PROTECTED] > > > > > Subject: DO NOT REPLY [Bug 12819] - > > > org.apache.struts.util.AppException > > > > > should have protected properties instead of private properties > > > > > > > > > > > > > > > DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG > > > > > RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT > > > > > <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12819>. > > > > > ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND > > > > > INSERTED IN THE BUG DATABASE. > > > > > > > > > > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12819 > > > > > > > > > > org.apache.struts.util.AppException should have protected > > > > > properties instead of private properties > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ------- Additional Comments From [EMAIL PROTECTED] 2002-09-20 > > > > > 14:26 ------- > > > > > Make private member protected and add constructor > > > > > for arrays. This make it consistent with ActionMessage > > > > > interface, and ActionError. > > > > > > > > > > I Smell an interface here :-) !!! > > > > > > > > > > -- > > > > > To unsubscribe, e-mail: > > > > > <mailto:[EMAIL PROTECTED]> > > > > > For additional commands, e-mail: > > > > > <mailto:[EMAIL PROTECTED]> > > > > > > > > > > > > > > > > >________________________________________________________________ > > > >Etudiant: Wanadoo t'offre le Pack eXtense Haut Débit soit > 150,92 euros > > > >d'économies ! > > > >Et pour 1 euro de plus, reçois le CD-ROM du jeu Dark Age of Camelot > > > >+ 1 mois de jeu en réseau offert ! > > > >Clique ici : http://www.ifrance.com/_reloc/mail.etudiant > > > > > > > > > > > >-- > > > >To unsubscribe, e-mail: > > > ><mailto:[EMAIL PROTECTED]> > > > >For additional commands, e-mail: > > > ><mailto:[EMAIL PROTECTED]> > > > > > > > > > > > > > > > _________________________________________________________________ > > > MSN Photos is the easiest way to share and print your photos: > > > http://photos.msn.com/support/worldwide.aspx > > > > > > > > > -- > > > To unsubscribe, e-mail: > > > <mailto:[EMAIL PROTECTED]> > > > For additional commands, e-mail: > > > <mailto:[EMAIL PROTECTED]> > > > > > > > > > ________________________________________________________________ > > > Etudiant: Wanadoo t'offre le Pack eXtense Haut Débit soit 150,92 > > > euros d'économies ! > > > Et pour 1 euro de plus, reçois le CD-ROM du jeu Dark Age of Camelot > > > + 1 mois de jeu en réseau offert ! > > > Clique ici : http://www.ifrance.com/_reloc/mail.etudiant > > > > > >________________________________________________________________ > >Etudiant: Wanadoo t'offre le Pack eXtense Haut Débit soit 150,92 euros > >d'économies ! > >Et pour 1 euro de plus, reçois le CD-ROM du jeu Dark Age of Camelot > >+ 1 mois de jeu en réseau offert ! > >Clique ici : http://www.ifrance.com/_reloc/mail.etudiant > > > > > >-- > >To unsubscribe, e-mail: > ><mailto:[EMAIL PROTECTED]> > >For additional commands, e-mail: > ><mailto:[EMAIL PROTECTED]> > > > > > _________________________________________________________________ > Send and receive Hotmail on your mobile device: http://mobile.msn.com > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> ________________________________________________________________ Etudiant: Wanadoo t'offre le Pack eXtense Haut Débit soit 150,92 euros d'économies ! Et pour 1 euro de plus, reçois le CD-ROM du jeu Dark Age of Camelot + 1 mois de jeu en réseau offert ! Clique ici : http://www.ifrance.com/_reloc/mail.etudiant ______________________________________________________________________ Etudiant: Wanadoo t'offre le Pack eXtense Haut Débit soit 150,92 euros d'économies ! Clique ici : http://www.ifrance.com/_reloc/mail.etudiant -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>