Task 3: Complete SearchController

Add a displaySearchResults handler method to SearchController:

  1. Use the correct annotation for the method. To configure the correct mapping type and mapping route, refer to the form tag in the search.html template. (Use @GetMapping or @PostMapping rather than @RequestMapping.)
  2. The displaySearchResults method should take in a Model parameter.
  3. The method should also take in two other parameters, specifying the type of search and the search term.
  4. In order for these last two parameters to be properly passed in by Spring Boot, you need to use the correct annotation. Also, you need to name them appropriately, based on the corresponding form field names defined in search.html.
  5. If the user enters “all” in the search box, or if they leave the box empty, call the findAll() method from JobData. Otherwise, send the search information to findByColumnAndValue. In either case, store the results in a jobs ArrayList.
  6. Pass jobs into the search.html view via the model parameter.
  7. Pass ListController.columnChoices into the view, as the existing search handler does.