Hi!

I'm using struts 2.3.3. And I have marked following problem. When I have
some hierarchy of inheritance, then value is not automatically injected in
inherited action. Example:

abstract class BaseAction extends ActionSupport {
...
}

class NewItem extends BaseAction {
...
}

class ItemDetails extends BaseAction {
   protected BigInteger itemId;
  public BigInteger getItemId(){return itemId;}
  public void setItemId(BigInteger itemId){this.itemId=itemId;}
...
}

class SaveItem extends ItemDetails {
...
}

I submit form to action "SaveItem" and (surprise-surprise) value is not
injected into itemId. And I see OGNL exception, that there's no method
SaveItem.setItemId(BigInteger).
Only working work-around is to explicitly create setter in SaveItem action.
But I hate this approach, because it forces me to create stupid code.

The same stuff is even if I try to make field public. Anyway, it's not seen
by framework and value is not injected.

Is it a known issue? Or probably I'm just using struts2 actions somehow
strange?

BR,
Dionis

Reply via email to