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

Key: XW-332
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Alexandru Popescu
Reporter: Alberto Vilches
Votes: 0
Watchers: 0
Operations

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

Chain Result throws Exception when you use a actionName with a method

Created: 02/Feb/06 06:38 AM   Updated: 03/Mar/06 11:55 AM
Component/s: None
Affects Version/s: 1.1.1
Fix Version/s: 1.1.2


 Description  « Hide
If you use this example result type

<result type="chain" name="input.show">
                <param name="actionName">User!list</param>
                <param name="namespace">/admin</param>
            </result>

You get an Exception.

The solution is in com.opensymphony.xwork.DefaultActionProxy.java

protected DefaultActionProxy(String namespace, String actionName, Map extraContext, boolean executeResult, boolean cleanupContext) throws Exception {
        this.cleanupContext = cleanupContext;
        if (LOG.isDebugEnabled()) {
            LOG.debug("Creating an DefaultActionProxy for namespace " + namespace + " and action name " + actionName);
        }

// START PATCH

int posExcl = actionName.indexOf("!");
        if (posExcl > -1) {
            this.method = actionName.substring(posExcl+1);
            actionName = actionName.substring(0, posExcl);
        }

// END PATCH

this.actionName = actionName;
        this.namespace = namespace;
        this.executeResult = executeResult;
        this.extraContext = extraContext;


 All   Comments   Change History      Sort Order:
Alexandru Popescu - [08/Feb/06 10:28 AM ]
I remember talking about this issue and having a patch for it, but I cannot find it now.

./alex
--
.w( the_mindstorm )p.

Claus Ibsen - [27/Feb/06 03:43 AM ]
<param name="actionName">User!list</param>

Shouldn't it parse the actionName and seperate the action name and the method name?

this.actionName = User
this.methodName = list

Maybe it's quite easy to fix for 1.1.2?

Rainer Hermanns - [02/Mar/06 02:13 PM ]
Alex, assigning this one to you... Did you find your patch?

Alexandru Popescu - [02/Mar/06 02:14 PM ]
I haven't, but I will take of it ;-).

./alex
--
.w( the_mindstorm )p.

Alexandru Popescu - [02/Mar/06 03:37 PM ]
Added method parameter to configuration (cleaner than the ! notation).
ActionChainResult v1.11

Claus Ibsen - [03/Mar/06 02:33 AM ]
@Alex

So should we use it like this?

<result type="chain" name="input.show">
                <param name="actionName">User</param>
                <param name="method">list</param>
                <param name="namespace">/admin</param>
            </result>

If so shouldn't we add an example to the class javadoc? It's much easier for new users to learn by example

Alexandru Popescu - [03/Mar/06 04:26 AM ]
I have added the information about the method parameter. Do you think it is still necessary to create another example in which to use the method? (cause there is already one showing how to pass the parameters and considering that the allowed parameters are listed imo this is obvious, but I may be wrong).

./alex
--
.w( the_mindstorm )p.

Claus Ibsen - [03/Mar/06 11:55 AM ]
@Alex

It's fine. Just that there is an example in the javadoc. This is the place where all the features should be documented.

Later someone could add examples to wiki's or to the showcase demo web app.

But the javadoc should IMHO always be updated with all the features WW+XW have.