title: I found a problem with ModelDriven of Struts2
body: <p>Please download <a href="http://pds20.egloos.com/pds/201008/18/05/ModelDriven_Test.war" rel="nofollow noreferrer">this</a> and run it.
  I think it's worth trying though it'll be a little annoying.</p>
  
  <p>In execute method of action class, if you set the bean by the method returning beans, Modeldriven won't work in JSP( <code>&lt;s:property "someField" /&gt;</code>won't work so you have to type the bean instance name like this;  <code>&lt;s:property "myBean.someField" /&gt;</code>).</p>
  
  <p>But if you set the bean's field value, Modeldriven will work.</p>
  
  <p>I know you may not believe me and think there's something else that I did wrong.
  But it's not true! Just try it.. </p>
  
  <pre><code>public class DefaultClass extends ActionSupport implements ModelDriven&lt;TestBean&gt;    {
          TestBean test = new TestBean();
          DAO db = DAO.getInstance();
  
          public String access() throws Exception {
              //Beans setter doesn't work!
              setTest( db.getTest() );
  
              return SUCCESS;
          }
          public String access2() throws Exception    {
              //Field setter works! 
              test.setA(db.getA());
              test.setB(db.getB());
  
              return SUCCESS;
          }
  </code></pre>
  
  <p>I didn't know what I just found. So I ask <a href="https://stackoverflow.com/questions/3438465/struts2-the-sequence-of-modeldriven-and-prepare">this question</a>. And as my own answer, if I push the bean to the valuestack Modeldriven will work.</p>
  
  <p>I wonder why there's no question about this. I think it's a serious problem.</p>