Struts2 filter isn't used during FORWARD, you must explicite configure
it to do so:
<filter-mapping>
<filter-name>strits2</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
2014-06-23 13:17 GMT+02:00 Mohit Gupta <[email protected]>:
> Actually when i am redirecting from legacy action to
> customer/customer-creater!create.action?custId=200, struts
> 2 successfully does type conversion but not while forwarding the request to
> same url though same struts2 filter comes in to picture. Any ideas what
> the issue ?
>
>
> On Mon, Jun 23, 2014 at 4:07 PM, Mohit Gupta <[email protected]> wrote:
>
>> I am hitting the customerAction (struts 2 action) from my legacy action
>> with url
>> customer/customer-creater!create.action?custId=200
>>
>> As soon call goes to my customerAction i get below error
>>
>> ognl.MethodFailedException: Method "setCustId" failed for object
>> com.actions.customer.CustomerCreateAction@c175e10
>> [java.lang.NoSuchMethodException:
>> com.actions.customer.CustomerCreateAction.setCustId([Ljava.lang.String;)]
>>
>> private int custId = -1;
>>
>> public void setCustId(int custId) {
>> this.custId = custId;
>> }
>>
>>
>> Struts somehow searching for setCustId with string parameter where method
>> exist with int parameter. As per my understanding struts 2
>> internally does type conversion. So i am not sure why i am getting this
>> issue?
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]