title: MethodFailedException in ognl.OgnlRuntime.callAppropriateMethod
body: <p>I have a working Action and JSP form that I'm using for creating new entities in my very basic Struts 2.2.1.1 app.  I'm trying to modify the app to re-use the same JSP form for the editing of entities.</p>
  
  <p>I added a "hidden" ID tag and now I'm getting errors when I submit the form. Can someone please give me some assistance?</p>
  
  <p>I've Googled this issue and seen others posting similar errors but I'm not sure how to resolve it.</p>
  
  <p>Excerpt from Stack Trace when I submit the form:</p>
  
  <pre><code>2011-05-02 11:09:36,132 3198497 ["http-bio-8080"-exec-23] WARN
  com.opensymphony.xwork2.ognl.OgnlValueStack - Error setting expression
  'id' with value '[Ljava.lang.String;@100ac03'
  ognl.MethodFailedException: Method "setId" failed for object
  org.robbins.flashcards.model.Tag@1b9eb34 [name='null' ]
  [java.lang.NoSuchMethodException:
  org.robbins.flashcards.model.Tag.setId([Ljava.lang.String;)]
      at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1285)
      at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:1474)
  </code></pre>
  
  <p>Excerpt from JSP:</p>
  
  <pre><code>&lt;%@ taglib prefix="s" uri="/struts-tags"%&gt;
  ...
  &lt;s:form action="saveOrUpdateTag" method="post"&gt;
      &lt;s:hidden name="id" /&gt;
      &lt;s:textfield name="name" key="label.tag.name" size="20" /&gt;
      &lt;s:submit label="label.flashcard.submit" align="center" /&gt;
  &lt;/s:form&gt;
  </code></pre>
  
  <p>Excerpt from Action Class:</p>
  
  <pre><code>public class TagAction extends FlashCardsAppBaseAction implements
  ModelDriven&lt;Tag&gt; {
  
      Tag tag = new Tag();
  
      public Tag getTag() {
          return tag;
      }
  
      public void setTag(Tag tag) {
          this.tag = tag;
      }
      public String createTag() {
          ...
         }
  }
  </code></pre>
  
  <p>Excerpt from POJO:</p>
  
  <pre><code>public class Tag  implements java.io.Serializable {
  
  
       private int id;
       private String name;
  
      public int getId() {
          return this.id;
      }
  
      public void setId(int id) {
          this.id = id;
      }
  ...
  }
  </code></pre>
  
  <p>Excerpt from Struts.xml</p>
  
  <pre><code>    &lt;action name="saveOrUpdateTag"
              class="org.robbins.flashcards.presentation.TagAction"
              method="createTag"&gt;
          &lt;result name="success" type="tiles"&gt;displaytag.tiles&lt;/result&gt;
          &lt;result name="input" type="tiles"&gt;tagform.tiles&lt;/result&gt;
      &lt;/action&gt;
  </code></pre>
  
  <p>FYI - I also submitted this question to the Struts-User distribution list but haven't received any input so I'm going to post it here also.  I'll update the other post and vice versa when more info is available.</p>