Skip to content

Commit e7f488a

Browse files
hihi
authored andcommitted
hello again
1 parent 3b97996 commit e7f488a

3 files changed

Lines changed: 25 additions & 4 deletions

File tree

Flipkart/src/main/java/com/test/HomeController.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,27 @@
55
import javax.servlet.http.HttpSession;
66

77
import org.springframework.stereotype.Controller;
8+
import org.springframework.web.bind.annotation.GetMapping;
9+
import org.springframework.web.bind.annotation.PostMapping;
810
import org.springframework.web.bind.annotation.RequestMapping;
911
import org.springframework.web.bind.annotation.RequestParam;
1012
import org.springframework.web.bind.annotation.ResponseBody;
1113
import org.springframework.web.servlet.ModelAndView;
1214

1315
@Controller
1416
public class HomeController {
15-
@RequestMapping("home")
17+
18+
19+
@GetMapping("home")
1620
public String home(@RequestParam("name") String myName) {
1721

1822
ModelAndView mv=new ModelAndView();
1923
mv.addObject("name", myName);
2024
mv.setViewName("home");
2125

22-
23-
return "home";
26+
return "home";
2427
}
28+
29+
30+
2531
}

Flipkart/src/main/webapp/pages/home.jsp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
<title>Insert title here</title>
88
</head>
99
<body>
10-
welcome ${name}
10+
<form method="get" action="details">
11+
Enter name: <input type="text" name = "name">
12+
<input type="submit">
13+
</form>
1114
</body>
1215
</html>
1316

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2+
pageEncoding="ISO-8859-1"%>
3+
<!DOCTYPE html>
4+
<html>
5+
<head>
6+
<meta charset="ISO-8859-1">
7+
<title>Insert title here</title>
8+
</head>
9+
<body>
10+
welcome ${name}
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)