struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <newton.d...@yahoo.com>
Subject Re: intercept return, and Interceptor implementing ServletRequestAware
Date Mon, 16 Apr 2007 01:53:07 GMT
--- Mansour <mansour77@yahoo.com> wrote:
> What's the point then of having an action, if the
> intercept method is going to execute the action. Why

> don't I just put the action code in an interceptor ?

Because interceptors are normally called for *groups*
of actions, not just one... just like it says in the
first couple of paragraphs at the top of:

http://struts.apache.org/2.x/docs/interceptors.html

For instance, "validation" is a cross-cutting concern.
So it makes sense to move it away from the code that
decides what to to with the validated data.

Of course you *could* put all your action code into an
interceptor and define an interceptor stack for every
action-that-no-longer-had-an-action. There are many
ways to make things harder--don't get me wrong, I
applaud your efforts to find them.

You could put all your action code into filters, then
you wouldn't even need servlets. Or put everything
inside a JSP, then you wouldn't even need to compile
or worry about whether or not your container
hot-deploys.

d.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Mime
View raw message