Question: These are the two methods i need to return on same JSP page. Unable to return pharmacysuccess jsp page to pharmacylist jsp page

```
@RequestMapping(value = { "/pharmacylist" }, method = RequestMethod.GET)
        public String listUsers(ModelMap model) {
            List<PharmacyMaster> pharmacyMaster = pharmacyService.findAllPharmacyMasters();
            model.addAttribute("pharmacyMaster", pharmacyMaster);
            model.addAttribute("loggedinuser", getPrincipal());
            return "pharmacy/pharmacylist";
        }

        @RequestMapping(value = { "/edit-pharmacy-{row_id}" }, method = RequestMethod.POST)
        public String updatePharmacyMaster(@Valid PharmacyMaster pharmacyMaster,
                BindingResult result, ModelMap model, @PathVariable int row_id) {

            /* checking the pharmacy form have any error. */
            if (result.hasErrors()) {
                return "/pharmacy/addpharmacy";
            }

            pharmacyMaster.setModifiedDate(new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
            pharmacyService.updatePharmacyMaster(pharmacyMaster);

            model.addAttribute("success", "pharmacy " + pharmacyMaster.getPharmacyName()
                    + " updated successfully");
            model.addAttribute("loggedinuser", getPrincipal());
            return "/pharmacy/pharmacylist";
        }

```

Answer: 
You can use the method `System.arrayCopy()` for that purpose. Since you use an array of primitive `int` type, the resulting array will be `[0, 0, 0, 0, 0, 1, 2, 3, 4, 5]`

```
System.arraycopy(ary1, 0, ary2, 5, ary1.length);

```

The arguments are:

1. Source-array
2. Start-position in source-array
3. Destination-array
4. Start-position in destination-array
5. Number of elements to copy
```
This will work 
int [] ary1 = {1,2,3,4,5};
    int [] ary2 = new int [10];
    int y = ary2.length-1;
    for (int i = ary1.length-1; i >=0; i--) {
        ary2[y]=ary1[i];
        y--;
    }

```