package com.naba.url.shortner;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class UrlShortnerController {

    @RequestMapping("/greeting")
    public String greeting(@RequestParam(value="name", required = false, defaultValue = "World") String name, Model model) {
        model.addAttribute("name", name);
        return "greeting";
    }
}

@@ -159,30 +159,28 @@
 otation.
-RequestMapping
+PathVariable
 ;%0Aimport
@@ -227,21 +227,23 @@
 .Request
-Param
+Mapping
 ;%0A%0A@Cont
@@ -309,24 +309,16 @@
 pping(%22/
-greeting
 %22)%0A    p
@@ -334,94 +334,149 @@
 ing 
-greeting(@RequestParam(value=%22name%22, required = false, defaultValue = %22World%22)
+landingPage() %7B%0A        return %22index%22;%0A    %7D%0A%0A    @RequestMapping(%22/url-shortner/%7Burl%7D%22)%0A    public String urlShortner(@PathVariable
  String 
 name
@@ -471,20 +471,19 @@
  String 
-name
+url
 , Model 
@@ -526,20 +526,19 @@
 %22name%22, 
-name
+url
 );%0A     
@@ -551,17 +551,17 @@
 urn %22gre
-e
+t
 ting%22;%0A 

Update controller * Add mapping for index page * Update mapping to url-shortner html page