title: Struts2 OGNL - Request parameters submission order
body: <p>I am using jsp and struts2, and I have the following scenario:</p>
  
  <pre><code>&lt;s:form&gt;
  &lt;s:hidden name="empId" value="123"/&gt;
  &lt;s:textfield name="employee.name"/&gt;
  &lt;s:submit action="save"/&gt;
  &lt;/s:form&gt;
  </code></pre>
  
  <p>When this form is submitted, the OGNL expression employee.name (equivalent to getEmployee().setName()) gets executed before "save" method. And, the value for "empId" is not available inside the method getEmployee(). The value for "empId" is available only inside the "save" method. Is it possible to get the value of "empId" inside getEmployee()?</p>
  
  <p>Following is the code in my Action class:</p>
  
  <pre><code>public String save() {
    //empId is available here
    return SUCCESS;
  }
  
  public Employee getEmployee(){
    if (employee == null){
      //empId is not available here
      employee = employeeService.get(empId);
    }
    return employee;
  }
  </code></pre>