title: In JSP/Java how can I replace getter/setter by s.th. more generic?
body: <p>I am getting tired by adding tons of getters/setters all the time in my beans.
  Is there a simple way to use annotations to get rid of this stupid work?
  or any other way? The 2nd example is the short version, which I would like to run, since there is no need to encapsulte my members (though in another context it might be neccessary).
  In my real world I have to access about 15 classes with about 10 data members in each class which would produce 300 useless setters/getters.</p>
  
  <p>Example TestPerson.java (works):</p>
  
  <pre><code>public class TestPerson {
    public String firstName;
    public String lastName;
    public TestPerson() {
      firstName = "Hugo";
    }
    public String getFirstName() {
      return firstName;
    }
    public void setFirstName(String firstName) {
      this.firstName = firstName;
    }
    public String getLastName() {
      return lastName;
    }
    public void setLastName(String lastName) {
      this.lastName = lastName;
    }
  }
  </code></pre>
  
  <p>Example TestPerson.java (does NOT work):</p>
  
  <pre><code>public class TestPerson {
    public String firstName;
    public String lastName;
    public TestPerson() {
      firstName = "Hugo";
    }
  }
  </code></pre>
  
  <p>Example test.jsp</p>
  
  <pre><code>&lt;jsp:useBean id="testperson" class="test.TestPerson" scope="request" /&gt;
  &lt;html&gt;
  &lt;head&gt;&lt;title&gt;Test&lt;/title&gt;&lt;/head&gt;
  &lt;body&gt;
  &lt;h2&gt;Results&lt;/h2&gt;${testperson.firstName}&lt;br&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>