title: Struts2 Configuration Understanding
body: <p>Recently I am going through with one tutorial for Struts2 UI Tags. So, I found that example and execute it with perfection.</p>
  
  <p>But, in the struts.xml configuration file, I couldn't understand some of the OGNL expressions. That I am writing here :</p>
  
  <pre><code>&lt;struts&gt;
      &lt;package name="default" extends="struts-default"&gt;
          &lt;action name="*Register" method="{1}" class="nirmal.RegisterAction"&gt;
              &lt;result name="populate"&gt;/register.jsp&lt;/result&gt;
              &lt;result name="input"&gt;/register.jsp&lt;/result&gt;
              &lt;result name="success"&gt;/success.jsp&lt;/result&gt;
          &lt;/action&gt;        
  
      &lt;/package&gt;
  &lt;/struts&gt;
  </code></pre>
  
  <p>Here I am populating one request at populateRegier from index.jsp, so it's redirecting it to RegisterAction.java and executing populate() method of my class, i.e. as follows :</p>
  
  <p>RegisterAction.java</p>
  
  <pre><code>package nirmal;
  
  import java.util.ArrayList;
  
  import com.opensymphony.xwork2.ActionSupport;
  
  public class RegisterAction extends ActionSupport {
  
      private String userName;
      private String password;
      private String gender;
      private String about;
      private String country;
      private ArrayList&lt;Country&gt; countryList;
      private String[] community;
      private ArrayList&lt;String&gt; communityList;
      private Boolean  mailingList;
  
      public String populate() {
  
          countryList = new ArrayList&lt;Country&gt;();
          countryList.add(new Country(1, "India"));
          countryList.add(new Country(2, "USA"));
          countryList.add(new Country(3, "France"));
  
          communityList = new ArrayList&lt;String&gt;();
          communityList.add("Java");
          communityList.add(".Net");
          communityList.add("SOA");
  
          community = new String[]{"Java",".Net"};
          mailingList = true;
  
          return "populate";
      }
      public String execute() {
          return SUCCESS;
      }
      public String getUserName() {
          return userName;
      }
      public void setUserName(String userName) {
          this.userName = userName;
      }
      public String getPassword() {
          return password;
      }
      public void setPassword(String password) {
          this.password = password;
      }
      public String getGender() {
          return gender;
      }
      public void setGender(String gender) {
          this.gender = gender;
      }
      public String getAbout() {
          return about;
      }
      public void setAbout(String about) {
          this.about = about;
      }
      public String getCountry() {
          return country;
      }
      public void setCountry(String country) {
          this.country = country;
      }
      public ArrayList&lt;Country&gt; getCountryList() {
          return countryList;
      }
      public void setCountryList(ArrayList&lt;Country&gt; countryList) {
          this.countryList = countryList;
      }
      public String[] getCommunity() {
          return community;
      }
      public void setCommunity(String[] community) {
          this.community = community;
      }
      public ArrayList&lt;String&gt; getCommunityList() {
          return communityList;
      }
      public void setCommunityList(ArrayList&lt;String&gt; communityList) {
          this.communityList = communityList;
      }
      public Boolean getMailingList() {
          return mailingList;
      }
      public void setMailingList(Boolean mailingList) {
          this.mailingList = mailingList;
      }
  }
  </code></pre>
  
  <p><strong>First Question :</strong> I couldn't understand why it's exeucting populate() method here ?</p>
  
  <p><strong>Second Question :</strong> What is the meaning of <code>method="{1}"</code> in struts2.xml ?</p>
  
  <p>Thanks in advance...</p>