Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package Team5.SmartTowns.placeswithcoordinates;
import Team5.SmartTowns.trails.Trail;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import java.util.List;
@Controller
public class PlacesController {
//GC example
// @GetMapping("/allTrails")
// public ModelAndView getAllTrails(){
// ModelAndView mav = new ModelAndView("allTrails/allTrails");
// mav.addObject("trails", Trail.trails); //Mock data for trails
// return mav;
// }
// @RequestMapping(value="/id", method= RequestMethod.POST)
// public String sendHtmlFragment(Model map) {
// map.addAttribute("foo", "bar");
// return "allTrails/allTrails";
// }
//
// @GetMapping("/allTrails/{id}")
// public ModelAndView getResultBySearchKey(@PathVariable int id)
// {
// List<Trail> trailList= Trail.trails;//results from db
// ModelAndView mv= new ModelAndView("fragments/allTrailsFrags :: trailSection");
// mv.addObject("trail", trailList.get(id-1));
// return mv;
// }
}