title: How to print the HasMap key and value data in separate text fields?
body: <p>I am using Struts2 tags in JSP. Below is the <code>Action</code> class.</p>
  <pre><code>package com.action;
  import java.util.ArrayList;
  import java.util.HashMap;
  import java.util.Map;
  import java.util.List;
  import com.opensymphony.xwork2.ActionSupport;
  public class EmpLeavePlan extends ActionSupport{
  private String bankId;
  private String empName;
  private String monthYear;
  private String leaves;
  private Map&lt;String,String&gt; bankIds;
  public String display() {
      return &quot;SUCESS&quot;;
  }
  public String getDefaultSearchEngine() {
      return &quot;yahoo.com&quot;;
  }
  public String execute() throws Exception
  {
      bankIds = new HashMap&lt;String,String&gt;();
      bankIds.put(&quot;1541742&quot;,&quot;h6&quot;);
      bankIds.put(&quot;1541742&quot;,&quot;eft&quot;);
      bankIds.put(&quot;1394842&quot;,&quot;dfd&quot;);
      bankIds.put(&quot;1541742&quot;,&quot;dfee&quot;);
          return &quot;SUCCESS&quot;;}
  public String getBankId() {
      return bankId;
  }
  public Map&lt;String, String&gt; getBankIds() {
      return bankIds;
  }
  public void setBankIds(Map&lt;String, String&gt; bankIds) {
      this.bankIds = bankIds;
  }
  public void setBankId(String bankId) {
      this.bankId = bankId;
  }
  public String getEmpName() {
      return empName;
  }
  public void setEmpName(String empName) {
      this.empName = empName;
  }
  public String getMonthYear() {
      return monthYear;
  }
  public void setMonthYear(String monthYear) {
      this.monthYear = monthYear;
  }
  public String getLeaves() {
      return leaves;
  }
  public void setLeaves(String leaves) {
      this.leaves = leaves;
  }}
  </code></pre>
  <p><strong>JSP:</strong></p>
  <pre class="lang-jsp prettyprint-override"><code>  &lt;%@ taglib uri=&quot;/struts-tags&quot; prefix=&quot;s&quot; %&gt;
   &lt;link rel=&quot;stylesheet&quot; href=&quot;//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css&quot;&gt;
    &lt;script src=&quot;//code.jquery.com/jquery-1.10.2.js&quot;&gt;&lt;/script&gt;
    &lt;script src=&quot;//code.jquery.com/ui/1.11.4/jquery-ui.js&quot;&gt;&lt;/script&gt;
    &lt;link rel=&quot;stylesheet&quot; href=&quot;/resources/demos/style.css&quot;&gt;
    &lt;script&gt;
    $(function() {
        var currentDate = new Date();
        $(&quot;#datepicker&quot;).datepicker( {
            changeMonth: true,
            changeYear: true,
            showButtonPanel: true,
            dateFormat: 'MM yy'
            /* onClose: function(dateText, inst) { 
                $(this).datepicker('setDate', new Date(inst.selectedYear, inst.selectedMonth, 1));
            } */
            
        });
        $(&quot;#datepicker&quot;).datepicker(&quot;setDate&quot;, currentDate);
        
        
    });
    
     &lt;/script&gt;
    
    &lt;style&gt;
  .ui-datepicker-calendar {
      display: none;
     
      }
      .ui-datepicker-year{
    
      width: 70px !important;
      height: 25px;
       }
      .ui-datepicker-month{
       width: 60px !important;
      height: 25px;
      }
      .ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all{
      width: 213px !important;
      }
  &lt;/style&gt;
  &lt;h1&gt; Leave Plan Management!!! &lt;/h1&gt;
  &lt;body style=&quot;background-color:lightgrey;&quot;&gt;
  &lt;s:form action=&quot;bankgen&quot;&gt;
  &lt;s:textfield name=&quot;monthYear&quot; label=&quot;Month/Year&quot; id=&quot;datepicker&quot;&gt;&lt;/s:textfield&gt;
  &lt;%-- &lt;s:select label=&quot;Select Bank ID&quot; 
          headerKey=&quot;-1&quot; headerValue=&quot;Select bank id&quot;  list=&quot;bankIds&quot; 
          name=&quot;bankIdd&quot; id=&quot;bankChange&quot; /&gt; --%&gt;
  &lt;s:select label=&quot;Select Bank ID&quot; 
          headerKey=&quot;-1&quot; headerValue=&quot;Select bank id&quot;  list=&quot;bankIds&quot;  
          name=&quot;bankId&quot; id=&quot;bankChange&quot; /&gt;    
          
  &lt;s:textfield name=&quot;empName&quot; label=&quot;Name&quot; id=&quot;empName&quot;&gt;&lt;/s:textfield&gt;
  &lt;s:textarea name=&quot;leaves&quot; label=&quot;Leaves :&quot; id=&quot;leaves&quot;&gt;&lt;/s:textarea&gt;
  &lt;s:submit value=&quot;save&quot;&gt;&lt;/s:submit&gt;
  
  &lt;/s:form&gt;
  &lt;/body&gt;
  </code></pre>
  <p>However, I am not getting the output. In the dropdown the values alone are reflection and not the key which is the <code>bank id</code>. I want the bank ids to be in the <code>bank id</code> column and the key values to be in the <code>emp</code> name column.</p>