Make use of new GetMapping and PostMapping annotations
Closes gh-5277
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2014 the original author or authors.
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -24,7 +24,7 @@ import sample.jpa.repository.NoteRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
@Controller
|
||||
@@ -33,7 +33,7 @@ public class IndexController {
|
||||
@Autowired
|
||||
private NoteRepository noteRepository;
|
||||
|
||||
@RequestMapping("/")
|
||||
@GetMapping("/")
|
||||
@Transactional(readOnly = true)
|
||||
public ModelAndView index() {
|
||||
List<Note> notes = this.noteRepository.findAll();
|
||||
|
||||
Reference in New Issue
Block a user