Skip to content
Snippets Groups Projects
Commit 2148b755 authored by Yibo Zhu's avatar Yibo Zhu
Browse files
parents 61e25320 5832720a
No related branches found
No related tags found
3 merge requests!20Five pages index controller,!19Five pages index controller,!1Dev
package uk.ac.cf.spring.demo.takeaway.index;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;
@Controller
public class IndexController {
@GetMapping("/index")
public ModelAndView getIndex() {
ModelAndView modelAndView = new ModelAndView("/index/index");
return modelAndView;
}
}
<header>
<div> i am header</div>
</header>
\ No newline at end of file
...@@ -3,8 +3,15 @@ ...@@ -3,8 +3,15 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Title</title> <title>Title</title>
<script src="../../static/lib/jquery.js"></script>
<script>
$(".header").load("templates/fragments/header.html", function (data, status, xhr) {});
</script>
</head> </head>
<body> <body>
<div class="header"></div>
<div>11111</div>
<div>2222</div>
</body> </body>
</html> </html>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment