You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Dimitri Valdin <di...@db.com> on 2002/01/02 21:20:20 UTC

Errors handling

What do you think about extending of Action.execute() with errors parameter ?
At that case ActionServlet will take care about saving of errors in HttpServletRequest and
errors won't get lost in case some exception occurs and they were not saved yet.

Craig, why don't you want to handle "error.password.mismatch" as exception,
but add error manually ? I think, that the check user.getPassword().equals(password)
should be done somewhere deep in code, perhaps in EJB or realm but not in Action class.
You have probably some reasons doing this.

Dmitri Valdin



--

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Errors handling

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Wed, 2 Jan 2002, Dimitri Valdin wrote:

> Date: Wed, 2 Jan 2002 21:20:20 +0100
> From: Dimitri Valdin <di...@db.com>
> Reply-To: Struts Developers List <st...@jakarta.apache.org>
> To: Struts Developers List <st...@jakarta.apache.org>
> Subject: Errors handling
>
>
> What do you think about extending of Action.execute() with errors parameter ?
> At that case ActionServlet will take care about saving of errors in HttpServletRequest and
> errors won't get lost in case some exception occurs and they were not saved yet.
>
> Craig, why don't you want to handle "error.password.mismatch" as exception,
> but add error manually ? I think, that the check user.getPassword().equals(password)
> should be done somewhere deep in code, perhaps in EJB or realm but not in Action class.
> You have probably some reasons doing this.
>

In my view there will often be validations that are performed at various
levels (inside the client, as part of the form bean's validate() method,
and by the business logic tier).  In this particular case, you typically
can't validate the password inside the form bean's validate() method --
that would take interacting with the business logic being used to
represent your user database.  That's why I treated this one separately,
and did the check in the Action (which would usually be done by a database
query or directory server lookup in a real application).

The validate() method *does* check for the fact that both the username and
password are required -- that's something you can check without
interacting with the business logic tier.

> Dmitri Valdin
>

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>