Class ArrayMapController

java.lang.Object
com.iu.javadatastructureslab.controller.ArrayMapController

@Controller public class ArrayMapController extends Object
Handles requests for the ArrayMap demo page.
  • Constructor Details

    • ArrayMapController

      public ArrayMapController()
  • Method Details

    • arrayMap

      @GetMapping("/arraymap") public String arrayMap(org.springframework.ui.Model model)
      Renders the ArrayMap view with current entries and size metadata.
      Parameters:
      model - model used to expose view attributes
      Returns:
      the ArrayMap view name
    • addToArrayMap

      @PostMapping("/arraymap/add") public String addToArrayMap(@RequestParam String key, @RequestParam String value)
      Adds a key/value entry to the ArrayMap.
      Parameters:
      key - entry key
      value - entry value
      Returns:
      redirect to the ArrayMap view
    • removeFromArrayMap

      @PostMapping("/arraymap/remove") public String removeFromArrayMap(@RequestParam String key)
      Removes an entry from the ArrayMap by key.
      Parameters:
      key - entry key to remove
      Returns:
      redirect to the ArrayMap view