title: How to convert a calendar object to date in struts2 textfield tag
body: <p>I am editing a users profile, I need a way to edit the user's date of birth. In my action class the dateOfBirth is a Calendar object. Now how can populate the date in the date of birth text field.</p>
  
  <pre><code>&lt;s:textfield id="txtDob" name="dateOfBirth" /&gt;
  
  
  public class Person {
  
      private Calendar dateOfBirth;
      public Calendar getDateOfBirth() {    
          return dateOfBirth;
      }
      public void setDateOfBirth(Calendar dateOfBirth) {    
          this.dateOfBirth = dateOfBirth;
      }
  }
  </code></pre>
  
  <p>when i run the jsp, this is what i get inside the textfield</p>
  
  <pre><code>java.util.GregorianCalendar[time=366229800000,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="Asia/Calcutta",offset=19800000,dstSavings=0,useDaylight=false,transitions=6,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=1981,MONTH=7,WEEK_OF_YEAR=33,WEEK_OF_MONTH=3,DAY_OF_MONTH=10,DAY_OF_YEAR=222,DAY_OF_WEEK=2,DAY_OF_WEEK_IN_MONTH=2,AM_PM=0,HOUR=0,HOUR_OF_DAY=0,MINUTE=0,SECOND=0,MILLISECOND=0,ZONE_OFFSET=19800000,DST_OFFSET=0]
  </code></pre>