struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicolas De Loof" <nicolas.del...@cgey.com>
Subject Re: actions best practice question
Date Fri, 18 Jul 2003 12:24:01 GMT
According to MVC pattern ,alway link to action, not to JSP. This way you controler always knows
what the user is doing,
and you can add some logic if needed.

Using a request parameter to addapt action behaviour is a common Struts use (take a look at
DispatchAction).

Nico.




> I have a login page with a link with "forgot password?" for users to
> retrieve the passwords to their email account in case they forgot it.
> It's pretty trivial but still using struts what is the best practice?
>
> Should the link inside the login page point to the ForgotPassword.jsp or
> to a ForgotPassword.do action?
>
> Currently I used a ForgotPassword.do, and in the action I check if
> there's an 'action' parameter with the value of 'send'. If the 'action'
> parameter does not exist then I locally forward to the
> ForgotPassword.jsp using struts-config.xml local forwards configuration.
> If it does exist and equals to 'send' then I perform the actual
> operation of going to the EJB layer and do what is necessary to do.
> Is this the way to do it, or am I missing the point here?
>
> Any comment would be greatly appreciated here,
> Thanks,
> Erez
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message