Hi I am using java springs.I am having problem in passing value to an array in the model class .I am giving the code plz help me to solve my problem.

This is my model class named as PayRollTypeOutDto

Java Code:
public class PayRollTypeOutDto implements Serializable {
            private String pay_Id;
            private String payroll_Type;
            private String[] selectHeader;
            private String[] header_pay;
            private String[] header_type;

    public PayRollTypeOutDto(){
        
    }

    public PayRollTypeOutDto(String[] header_pay, String[] header_type) {
        this.header_pay = header_pay;
        this.header_type = header_type;
    }




    public String getPay_Id() {
        return pay_Id;
    }

    public void setPay_Id(String pay_Id) {
        this.pay_Id = pay_Id;
    }

    public String getPayroll_Type() {
        return payroll_Type;
    }

    public void setPayroll_Type(String payroll_Type) {
        this.payroll_Type = payroll_Type;
    }

    public String[] getSelectHeader() {
        return selectHeader;
    }

    public void setSelectHeader(String[] selectHeader) {
        this.selectHeader = selectHeader;
    }

    public String[] getHeader_pay() {
        return header_pay;
    }

    public void setHeader_pay(String[] header_pay) {
        this.header_pay = header_pay;
    }

    public String[] getHeader_type() {
        return header_type;
    }

    public void setHeader_type(String[] header_type) {
        this.header_type = header_type;
    }

    @Override
    public String toString() {
        return "PayRollTypeOutDto{" +
                "pay_Id='" + pay_Id + '\'' +
                ", payroll_Type='" + payroll_Type + '\'' +
                ", selectHeader=" + (selectHeader == null ? null : Arrays.asList(selectHeader)) +
                ", header_pay=" + (header_pay == null ? null : Arrays.asList(header_pay)) +
                ", header_type=" + (header_type == null ? null : Arrays.asList(header_type)) +
                '}';
    }
}
This the dao layer where I guess my problem lies


Java Code:
public PayRollTypeOutDto getPayRollType() {
        final String methode_name = "PayRollTypeOutDto getPayRollType()";

        String comSql = "SELECT pay_head_name,addition_deduction FROM payhead group by addition_deduction,pay_head_name order by addition_deduction desc";
        SqlRowSet srs = this.jdbcTemplate.queryForRowSet(comSql);
        int i = 0;
        PayRollTypeOutDto payRollTypeOutDto=null;
        while (srs.next()) {
        payRollTypeOutDto = new PayRollTypeOutDto();
            payRollTypeOutDto.setHeader_pay(new String[]{srs.getString("pay_head_name")});
            payRollTypeOutDto.setHeader_type(new String[]{srs.getString("addition_deduction")});

            i++;
        }
        return payRollTypeOutDto;

    }



This my controller part




Java Code:
    
 @RequestMapping("/payrolltype.htm")
    public String showPayRollType(ModelMap model, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException {
       String methodeName = "showPayRollType() /payrolltype.htm";

try{
         PayRollTypeInDto payrollTypeInDto = new PayRollTypeInDto();
         model.addAttribute("payrolltype",payrollTypeInDto);
          MasterDaoExt2 masterdaoExt2 = new MasterDaoImpExt2(this.jdbcTemplate);

           System.out.println("yyyyyyyyyyyyyyy"+masterdaoExt2.getPayRollType());
          httpServletRequest.setAttribute("rollList", masterdaoExt2.getPayRollType());

}catch(Exception e){
          System.out.println("err");
    JCLogger.log(CLASS, methodeName, " Going to load :::dto::"+ e.getMessage(), JCLogger.INFO);
}

           return "payrolltype";

     }