You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by mraible <ma...@raibledesigns.com> on 2007/02/08 22:04:58 UTC

[struts 2] Simplifying the interceptor stack

I'm working to simplify the stack that I used to use in a WebWork
application.  Here's what I currently have:

        <interceptors>
            <!-- Interceptor to handle allowing only admins to certain
actions -->
            <interceptor name="adminOnly" class="adminInterceptor"/>
            <!-- https://issues.apache.org/struts/browse/WW-1187 -->
            <interceptor-stack name="defaultStack">
                <interceptor-ref name="exception"/>
                <interceptor-ref name="alias"/>
                <interceptor-ref name="servlet-config"/>
                <interceptor-ref name="prepare"/>
                <interceptor-ref name="i18n"/>
                <interceptor-ref name="chain"/>
                <interceptor-ref name="model-driven"/>
                <interceptor-ref name="fileUpload"/>
                <interceptor-ref name="static-params"/>
                <interceptor-ref name="params"/>
                <interceptor-ref name="conversionError"/>
                <interceptor-ref name="validation">
                    <param
name="excludeMethods">cancel,execute,delete,edit,list,start</param>
                </interceptor-ref>
                <interceptor-ref name="workflow">
                    <param name="excludeMethods">input,back,cancel</param>
                </interceptor-ref>
            </interceptor-stack>
        </interceptors>

Is there an easier way to override the validation and workflow methods? 
Someone recently pointed out that I don't have the checkbox interceptor in
my stack (which didn't exist in WW).

Is it possible to remove everything but the validation and workflow
interceptors?

Also, are there any performance reasons to have separate stacks for display
only (list) screens vs. forms (crud)?

Thanks,

Matt
-- 
View this message in context: http://www.nabble.com/-struts-2--Simplifying-the-interceptor-stack-tf3196039.html#a8874246
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: [struts 2] Simplifying the interceptor stack

Posted by Tom Schneider <sc...@gmail.com>.
I can confirm these results based on my own webwork profiling 
experience.  I wouldn't worry too much about interceptors that you don't 
use--the penalty is very minimal.

David H. DeWolf wrote:
>
>
> mraible wrote:
>>
>> Also, are there any performance reasons to have separate stacks for 
>> display
>> only (list) screens vs. forms (crud)?
>
> I recently went through a series of performance monitoring and tuning
> and found that standard interceptors that are NOT executed are logged as
> taking 0ms.  So, whatever the cost, it's fairly small.
>
> Have you tried turning on the -Dxwork.profile.activate=true switch to
> find the metrics. See:
> http://struts.apache.org/2.x/struts2-core/apidocs/com/opensymphony/xwork2/util/profiling/UtilTimerStack.html 
>
>
>
> David
>
>>
>> Thanks,
>>
>> Matt
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


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


Re: [struts 2] Simplifying the interceptor stack

Posted by "David H. DeWolf" <dd...@apache.org>.

mraible wrote:
> 
> Also, are there any performance reasons to have separate stacks for display
> only (list) screens vs. forms (crud)?

I recently went through a series of performance monitoring and tuning
and found that standard interceptors that are NOT executed are logged as
taking 0ms.  So, whatever the cost, it's fairly small.

Have you tried turning on the -Dxwork.profile.activate=true switch to
find the metrics. See:
http://struts.apache.org/2.x/struts2-core/apidocs/com/opensymphony/xwork2/util/profiling/UtilTimerStack.html


David

> 
> Thanks,
> 
> Matt


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