title: how variables declared private in javabean get accessed by jsp
body: <p>I have defined many private variables and also defined there getter/setter method and then I'm accessing these variables in jsp page by using expression language.But how privately defined variables gets accessed in jsp page??
  My java bean code is-
  The variables are</p>
  
  <pre><code>                private String beam_current;
                  private String beam_energy;
                  private String st4_vs6_bag1_rb;
                  private String st4_vs6_bag2_rb;
                  private String st4_vs6_bag3_rb;
                  private String st4_vs6_bag4_rb;
                  private String st4_vs6_bag5_rb;
                  private String st4_vs6_bag6_rb;
                  private String st4_vs6_bag7_rb;
                  private String st4_vs6_bag8_rb;
                  private String st4_vs6_bag9_rb;
  </code></pre>
  
  <p>There set method is used as-</p>
  
  <pre><code>                   while(rs.next()) 
                      {
                       Vacc_vs6 ref_drop=new Vacc_vs6();
                       ref_drop.setLogtime(rs.getString(1));
                       ref_drop.setBeam_current(rs.getString(2));
                       ref_drop.setBeam_energy(rs.getString(3));
                       ref_drop.setst4_vs6_bag1_rb(rs.getString(4));
                       ref_drop.setst4_vs6_bag2_rb(rs.getString(5));
                       ref_drop.setst4_vs6_bag3_rb(rs.getString(6));
                       ref_drop.setst4_vs6_bag4_rb(rs.getString(7));
                       ref_drop.setst4_vs6_bag5_rb(rs.getString(8));
                       ref_drop.setst4_vs6_bag6_rb(rs.getString(9));
                       ref_drop.setst4_vs6_bag7_rb(rs.getString(10));
                       ref_drop.setst4_vs6_bag8_rb(rs.getString(11));
  </code></pre>
  
  <p>There are getter and setter methods defined in the code as-</p>
  
  <pre><code>    public String getBeam_current() {
              return beam_current;
          }
  
          public void setBeam_current(String string) {
              this.beam_current = string;
          }
  </code></pre>
  
  <p>Now my jsp is:-</p>
  
  <pre><code>&lt;c:forEach var="r" items="${ref.refernece(param.ref_logtime)}" 
  
  begin="${count}" end="${count}"&gt; 
  
  &lt;tr bgcolor="darkgray "&gt;
  &lt;td&gt;&lt;c:out value="${r.logtime}"&gt;&lt;/c:out&gt;&lt;/td&gt;
  
  &lt;td&gt;
  &lt;c:choose&gt;&lt;c:when test="${(r.beam_current) ne 0}"&gt; 
  </code></pre>
  
  <p><strong>My query is,how I'm able to access variables beam_current and logtime when they are defined as private in java class??</strong></p>