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
 
Related



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Rainer Hermanns added a comment - 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 added a comment - 06/Mar/06 04:31 PM
Patches for easy interceptor config overriding

Rainer Hermanns added a comment - 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 added a comment - 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 added a comment - 06/Mar/06 04:49 PM
Patch for webwork tests

Gabriel Zimmerman added a comment - 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 added a comment - 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 added a comment - 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 added a comment - 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 added a comment - 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 added a comment - 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 added a comment - 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.