Welcome to the Treehouse Community
Looking to learn something new?
Is there any specific reason why the @RequestMapping for the gifDetails method is called "gif"? @RequestMapping("/gif")
I see that the name of the Gif object is called "gif" and also the first value of the modelMap.put method is also "gif" , does the name of the value in @RequestMapping HAVE to match anything else in the gifDetails method?
The first value in the modelMap.put method does not have to be gif. The value will determine how you access the properties of the gif object in the html code. Here are some scenarios.
// you place the gif object you created into the model
// To access properties of gif object in html file you use gif
If you want to change the "gif" in the modelMap.put to something else, like "changeFromGif" you have to change the access in the html file.
// Placing gif object into model
modelMap.put( "changeFromGif", gif);
// Accessing properties of gif object
The value in @RequestMapping(value="/gif") just means when a user goes to the /gif url, it will call the method below the request mapping annotation.
Hope this helps.