Use field.setMessage(errorMessage) to set the error message for intake
to display.  Next, redisplay the original page.

> -----Original Message-----
> From: Xavier Ottolini [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, January 16, 2003 8:00 AM
> To: turbine Users List
> Subject: group.setProperties throws an exception, how to get 
> the original e.getMessage ?
> 
> 
> Hi,
> 
> I  use Intake to test the validity of my forms. Unfortunately, the 
> regular expression is not enough efficient for testing dates. For 
> instance, the date "11/31/2003" (november, the 31th 2003) 
> does not exist.
> 
> In the business object, a exception can be thrown is the date 
> is false.
>      public void setJourD(String s ) throws TurbineException
>      {
>          try
>          {
>              super.setJour(DateFormater.stringToDate(s));
>          } catch (Exception e) {
>              throw new TurbineException("Jour doit respecter 
> le format : 
> (\"jj/mm/aaaa\") et donner un jour valide.",e);
>         }
>      }
> 
> In the action class, the group is mapped to the bean. In the followin 
> code, entry is the bean and agendaGroup is the group.
>         try
>          {
>                     agendaGroup.setProperties(entry);
>         } catch (org.apache.turbine.util.TurbineException tex) {
>                
>         context.put("errorTemplate", tex.getMessage());
>                 context.put("mode", mode);
>                 data.getParameters().add("mode", mode);
>                 setTemplate(data, "/actu/AgendaForm.vm");
>             return false;
>     }
> 
> The problem is that the message tex.getMessage() of this turbine 
> exception is not the same as the message os the business 
> object. Le message is "An exception prevented the mapping to 
> fr.qualipse.qualiback.om.Agenda@345b43".
> 
> How can I avoid this and display the original message ?
> 
> I would appreciate some help.
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:turbine-user-> [EMAIL PROTECTED]>
> For 
> additional commands, 
> e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 

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

Reply via email to