Laurie Harper wrote:
Allen Gilliland wrote:
when chaining from one action to another, why is struts2 trying to lookup the "input" result on action2 before ever executing my action method?

i have a simple config, like the examples in the documentation ...

<action name="members!*" method="{1}"
        class="org.apache.roller.ui.authoring.struts2.Members">
    <result name="list" type="tiles">.Members</result>
</action>

<action name="invite!*" method="{1}"
        class="org.apache.roller.ui.authoring.struts2.MembersInvite">
    <result name="input" type="tiles">.MembersInvite</result>
    <result name="disabled" type="tiles">.disabled</result>
    <result name="success" type="chain">members</result>
</action>

when i execute the 'invite' action it stores an invitation in the db and adds an action message to notify the user and then i return SUCCESS, which should just chain to the execute() method of my 'members' action right?

well when i do this everything works properly in the 'invite' action and through debugging i can see that my 'members' action class is instantiated as if it's going to be executed, but the execute() method is never called and struts2 gives an error about not being able to find the "input" result on my 'members' action. why is this happening?

No result defined for action org.apache.roller.ui.authoring.struts2.Members and result input

Well, firstly, you don't have a result named 'input' on your members action... but I guess you're more interested in why Struts is looking for it :-)

yep, and i don't need an 'input' result on that action. the baffling part to me is why struts2 is even trying to look for that result when nothing in my action returns that result.



Does the members action have any conversion or validation configured? Struts will automatically forward to the 'input' result if errors occur during conversion or validation. If that's not it, you'll need to post more details, such as your action code and anything written to the logs as the request is being processed.

nope, no conversion or validation. i ran into the problem with the validation interceptor when i first started working with struts2 and mistakenly had a validation() method in my action without realizing struts2 was going to execute that method without my knowledge, but i removed all my old validation() methods so i know it's not that.

i'll post the skeleton of the action class if that will help, but it's quite simple.

public class Members extends UIAction implements ParameterAware {

    private static Log log = LogFactory.getLog(Members.class);

    // raw parameters from request
    private Map parameters = Collections.EMPTY_MAP;


    public Members() {
        log.debug("Instantiating members action");
    }

    public String execute() {

        log.debug("Showing weblog members page");

        return LIST;
    }

    public String save() {

        log.debug("Attempting to processing weblog permissions updates");

        ... do work ...

        return LIST;
    }

    // convenience for accessing a single parameter with a single value
    public String getParameter(String key) ...

    public Map getParameters() ...

    public void setParameters(Map parameters) ...
}


here's the full debugging output from my logs showing that the first action successfully completes and returns a SUCCESS result which chains to the second action, but I can't figure out what is causing struts2 to bail on the chain execution before even calling my action method ...

DEBUG 2007-05-03 14:42:57,717 MembersInvite:save - Invitation successfully recorded DEBUG 2007-05-03 14:42:57,727 ActionChainResult:execute - Chaining to action members DEBUG 2007-05-03 14:42:57,729 DefaultActionProxy:<init> - Creating an DefaultActionProxy for namespace /roller-ui/authoring and action name members DEBUG 2007-05-03 14:42:57,731 ActionConfigMatcher:match - Attempting to match 'members' to a wildcard pattern, 32 available DEBUG 2007-05-03 14:42:57,733 ActionConfigMatcher:match - Path matches pattern 'members!*'
DEBUG 2007-05-03 14:42:57,735 Members:<init> - Instantiating members action
DEBUG 2007-05-03 14:42:57,737 I18nInterceptor:intercept - intercept '/roller-ui/authoring/members' { DEBUG 2007-05-03 14:42:57,739 I18nInterceptor:intercept - requested_locale=null DEBUG 2007-05-03 14:42:57,741 I18nInterceptor:intercept - before Locale=en_US DEBUG 2007-05-03 14:42:57,763 InstantiatingNullHandler:nullPropertyValue - Entering nullPropertyValue [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED], property=inviteMember] DEBUG 2007-05-03 14:42:57,775 InstantiatingNullHandler:nullPropertyValue - Entering nullPropertyValue [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED], property=struts] DEBUG 2007-05-03 14:42:57,791 FileUploadInterceptor:intercept - Bypassing /roller-ui/authoring/ members DEBUG 2007-05-03 14:42:57,793 StaticParametersInterceptor:intercept - Setting static parameters {} DEBUG 2007-05-03 14:42:57,796 ParametersInterceptor:intercept - Setting params userName => [ blah ] weblog => [ test ] inviteMember.button.save => [ Send Invitation ] permission => [ 1 ] DEBUG 2007-05-03 14:42:57,799 InstantiatingNullHandler:nullPropertyValue - Entering nullPropertyValue [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED], property=inviteMember] ERROR 2007-05-03 14:42:57,805 ParametersInterceptor:setParameters - ParametersInterceptor - [setParameters]: Unexpected Exception catched: Error setting expression 'inviteMember.button.save' with value '[Ljava.lang.String;@a3c5b6' DEBUG 2007-05-03 14:42:57,808 XWorkConverter:getConverter - Property: permissionDEBUG 2007-05-03 14:42:57,811 XWorkConverter:getConverter - Class: org.apache.roller.ui.authoring.struts2.MembersInvite DEBUG 2007-05-03 14:42:57,814 XWorkConverter:convertValue - field-level type converter for property [permission] = none found DEBUG 2007-05-03 14:42:57,817 XWorkConverter:convertValue - global-level type converter for property [permission] = none found DEBUG 2007-05-03 14:42:57,821 XWorkConverter:convertValue - falling back to default type converter [EMAIL PROTECTED] DEBUG 2007-05-03 14:42:57,824 XWorkConverter:getConverter - Property: userName DEBUG 2007-05-03 14:42:57,826 XWorkConverter:getConverter - Class: org.apache.roller.ui.authoring.struts2.MembersInvite DEBUG 2007-05-03 14:42:57,828 XWorkConverter:convertValue - field-level type converter for property [userName] = none found DEBUG 2007-05-03 14:42:57,831 XWorkConverter:convertValue - global-level type converter for property [userName] = none found DEBUG 2007-05-03 14:42:57,833 XWorkConverter:convertValue - falling back to default type converter [EMAIL PROTECTED] ERROR 2007-05-03 14:42:57,836 ParametersInterceptor:setParameters - ParametersInterceptor - [setParameters]: Unexpected Exception catched: Error setting expression 'weblog' with value '[Ljava.lang.String;@182815a' DEBUG 2007-05-03 14:42:57,838 ValidationInterceptor:doBeforeInvocation - Validating /roller-ui/authoring/members with method execute. DEBUG 2007-05-03 14:42:57,868 DefaultWorkflowInterceptor:doIntercept - Invoking validate() on action [EMAIL PROTECTED] DEBUG 2007-05-03 14:42:57,871 PrefixMethodInvocationUtil:getPrefixedMethod - cannot find method [validateExecute] in action [EMAIL PROTECTED] DEBUG 2007-05-03 14:42:57,874 PrefixMethodInvocationUtil:getPrefixedMethod - cannot find method [validateDoExecute] in action [EMAIL PROTECTED] DEBUG 2007-05-03 14:42:57,876 DefaultWorkflowInterceptor:doIntercept - Errors on action [EMAIL PROTECTED], returning result name 'input' ERROR 2007-05-03 14:42:57,881 Dispatcher:serviceAction - Could not find action or result No result defined for action org.apache.roller.ui.authoring.struts2.Members and result input - action - file:/export/home/app/blogs/dev/webserver7/https-gconf/web-app/gconf/_default/WEB-INF/classes/struts.xml:232:72



L.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to