You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jim Kiley <jh...@summa-tech.com> on 2009/02/04 16:03:09 UTC

[s2] @Result annotation and namespace parameter

I'm feeling dim this morning and I hope you folks can help me out.
To simplify, I have two classes:

com.company.view.cust.my.order.FieldRepAction
com.company.view.cust.my.rep.ChooseCustomerAction

FieldRepAction has the following annotation:

@Result(value = "chooseCustomer!input.action",
        type = ServletRedirectResult.class,
        params={"namespace", "/cust/my/rep"})

But when I navigate to fieldRep.action and get redirected, I get a beautiful
Tomcat stack trace from Struts 2:

There is no Action mapped for namespace /cust/my/order and action name
chooseCustomer

It seems that I have the wrong "namespace" parameter in the @Result
annotation.  Can someone point me in the direction of a fix?
-- 
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com

Re: [s2] @Result annotation and namespace parameter

Posted by Jim Kiley <jh...@summa-tech.com>.
And of course the magic of sending my problem to the mailing list let me
figure out the solution on my own:
I should have been using ServletActionRedirectResult rather than
ServletRedirectResult.

jk

On Wed, Feb 4, 2009 at 10:03 AM, Jim Kiley <jh...@summa-tech.com> wrote:

> I'm feeling dim this morning and I hope you folks can help me out.
> To simplify, I have two classes:
>
> com.company.view.cust.my.order.FieldRepAction
> com.company.view.cust.my.rep.ChooseCustomerAction
>
> FieldRepAction has the following annotation:
>
> @Result(value = "chooseCustomer!input.action",
>         type = ServletRedirectResult.class,
>         params={"namespace", "/cust/my/rep"})
>
> But when I navigate to fieldRep.action and get redirected, I get a
> beautiful Tomcat stack trace from Struts 2:
>
> There is no Action mapped for namespace /cust/my/order and action name
> chooseCustomer
>
> It seems that I have the wrong "namespace" parameter in the @Result
> annotation.  Can someone point me in the direction of a fix?
> --
> Jim Kiley
> Technical Consultant | Summa
> [p] 412.258.3346 [m] 412.445.1729
> http://www.summa-tech.com
>



-- 
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com