History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: WW-1187
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Rainer Hermanns
Reporter: Matt Raible
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
WebWork

Allow easy overriding of "excludeMethods" and "includeMethods" of ValidationInterceptor

Created: 16/Feb/06 04:31 PM   Updated: 17/Mar/06 08:24 AM
Component/s: Interceptors
Affects Version/s: 2.2.1
Fix Version/s: 2.2.2

File Attachments: 1. Java Source File InterceptorMapping.java (1 kb)
2. Text File webwork-test.patch (3 kb)
3. Text File xwork-config-test.patch (18 kb)
4. Text File xwork-config.patch (9 kb)
5. XML File xwork-test-interceptor-params.xml (1 kb)

Issue Links:
Container
 
This issue is part of:
WW-1246 Document excludeMethods / includeMeth... Major Closed
Related
This issue relates to:
WW-1183 exclude methods for token interceptor Major Resolved
This issue is related to:
WW-1247 Document interceptor properties overr... Major Closed
WW-1093 Method Specification for Validation Major Resolved



 All   Comments   Change History      Sort Order:
Rainer Hermanns - [05/Mar/06 02:51 PM ]
Matt,

I added wildcard support for excludeMethods and includeMethods using the '*' character.
Please have a look if this works for you.

Furthermore I added result mapping with wildcard support.
If the resultCode is not found, additionally check for a '*' within the result mappings.

I will look into the "easy" overriding as soon.

cheers,
Rainer

Rainer Hermanns - [06/Mar/06 04:31 PM ]
Patches for easy interceptor config overriding

Rainer Hermanns - [06/Mar/06 04:34 PM ]
New files:
test/com/opensymphony/xwork/config/providers/xwork-test-interceptor-params.xml
src/java/com/opensymphony/xwork/config/entities/InterceptorMapping.java

Rainer Hermanns - [06/Mar/06 04:36 PM ]
Matt,

the above patch allows "easy" overriding of interceptor stacks.

Example of overridden Interceptor properties:

<interceptors>
            <interceptor name="timer" class="com.opensymphony.xwork.interceptor.TimerInterceptor"/>
            <interceptor name="test" class="com.opensymphony.xwork.mock.MockInterceptor">
                <param name="foo">fooDefault</param>
            </interceptor>

<interceptor-stack name="defaultStack">
                <interceptor-ref name="timer"/>
                <interceptor-ref name="test"/>
            </interceptor-stack>
        </interceptors>

<default-interceptor-ref name="defaultStack" />

<action name="TestInterceptorParam" class="com.opensymphony.xwork.SimpleAction">
            <interceptor-ref name="defaultStack">
                <param name="test.expectedFoo">expectedFooValue</param>
            </interceptor-ref>
        </action>

<action name="TestInterceptorParamOverride" class="com.opensymphony.xwork.SimpleAction">
            <interceptor-ref name="defaultStack">
                <param name="test.foo">foo123</param>
                <param name="test.expectedFoo">expectedFooValue2</param>
            </interceptor-ref>
        </action>

I did not yet commit the code, cause I want some others to review it...

Rainer Hermanns - [06/Mar/06 04:49 PM ]
Patch for webwork tests

Gabriel Zimmerman - [06/Mar/06 04:53 PM ]

Extremely cool patch.

The problem I see is what if different interceptors have the same parameter names. Then if you override one, you override them all. Could we do instead something like:

<action name="TestInterceptorParamOverride" class="com.opensymphony.xwork.SimpleAction">
            <interceptor-ref name="defaultStack">
              <interceptor-ref name="test">
                <param name="test.foo">foo123</param>
              </interceptor-ref>
            </interceptor-ref>
        </action>


Rainer Hermanns - [06/Mar/06 05:00 PM ]
Gabe,

this shouldn't be an issue...
'test' is the name of the referenced interceptor of the given stack.
So only interceptors with the name 'test' will get this params applied.

What do you think?

Rene Gielen - [08/Mar/06 03:16 AM ]
Rainer,

really great patch.
I agree with you that the parameter naming should not be an issue, since you did it hierarchical. It is really consistent with typical ognl features usage, so +1 from me for adding this to CVS.

Claus Ibsen - [08/Mar/06 05:59 AM ]
+1

I also think we should document this new cool feature and have one/few examples in our demo webapp.
And should the .DTD file be documented to with this feature?

Rainer Hermanns - [08/Mar/06 06:12 AM ]
Claus,

since there are no changes to be applied to the DTD, there shouldn't be a documentation need there.
(Just to be curious, are there any explanation docs within the DTD?)
But, you are right... We should and need to document this in the wiki.

I will commit the code later today (had no stable DSL connection yesterday) , then we can update the docs accordingly...

Rainer Hermanns - [08/Mar/06 09:22 AM ]
Matt,
patch is commited to CVS HEAD.
You can try either from source or get the updated jars from the ivyrep at opensymphony.

Matt Raible - [08/Mar/06 11:24 AM ]
Thanks! I'll try to look at this (as well as the other fixed issues) in the next couple days. It's a hectic week for me.