title: Cannot set values to variables in spring MVC
body: <p>I have created a class in my application for the table employees. Here is the class</p>
  
  <pre><code>package com.bct.internal.form.model;
  
  public class Employee {
  int id;
  String name;
  int salary;
  String designation;
  
  
  
  public String getName() {
      return name;
  }
  
  public void setName(String name) {
      this.name = name;
  }
  
  
  public String getDesignation() {
      return designation;
  }
  
  public int getId() {
      return id;
  }
  
  public void setId(int id) {
      this.id = id;
  }
  
  public int getSalary() {
      return salary;
  }
  
  public void setSalary(int salary) {
      this.salary = salary;
  }
  
  public void setDesignation(String designation) {
      this.designation = designation;
  }
  @Override
  public String toString() {
      return "Employee [ID=" + id + ", NAME=" + name
              + ", SALARY=" + salary + ", DESIGNATION=" + designation  + "]";
  }
  
  }
  </code></pre>
  
  <p>And i am passing values for that columns in a controller.</p>
  
  <pre><code>    public static final class EmployeeMapper implements RowMapper&lt;Employee&gt; 
      {
  
      public Employee mapRow(ResultSet rs, int rowNum) throws SQLException {
          Employee employee = new Employee();
          employee.setId(id);
          employee.setName(rs.getString("name"));
          employee.setSalary(salary);
          employee.setDesignation(rs.getString("designation"));
          return employee;
      }   
  
  }
  </code></pre>
  
  <p>But for id and salary "salary cannot be resolved to a variable". 
  What is the problem here.. Please help me..</p>
  
  <p>Sorry for my poor english.</p>