Skip to content

this JokeController worked for me, not the one on the repository #4

@mmaurier

Description

@mmaurier

@RestController
public class JokeController {

private JokeService jokeService;

@Autowired
public JokeController(JokeService jokeService) {
    this.jokeService = jokeService;
}

@RequestMapping("/norris")
public String showJoke() {

// public Model showJoke(Model model) {

// model.addAttribute("joke", jokeService.getJoke());
// return model;
return jokeService.getJoke();

}

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions