I've got a problem and I'm not sure whether it's my poor design or a struts
limitation. I'd appreciate it if someone can shed some light. Let me know if
you require more details.

I have an action mapping for an "update my profile" page with an associated
ActionForm and validate="true". In order to navigate to this form the user
has to login first. The Action itself checks that the user is logged in in
the perform() method. If he isn't then he's forwarded back to the login
action. This all works fine in the case where the session expires and the
user clicks on the link to take him to the form because he gets forwarded to
the login page.

My problem is that if he navigates to this form, then waits for the session
to timeout then clicks submit  then the validate() method on the ActionForm
is called BEFORE the perform() method on the Action itself. In my case the
validation fails as it relies on being able to read data from the session.

I can see a solution where in validation() methods I check that the session
is still valid but this seems clumsy to me. Is it good MVC design for the
request to be handled by the Model before the Controller gets to see it? Am
I incorrectly putting business logic into the validation() method when it
should be dealt with further down the chain? Or should I be handling my
authentication and session management in a subclass of the ActionServlet?

I'd appreciate any insights.
Matt.


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

Reply via email to