title: Request method 'GET' not supported Spring Boot
body: <p>I'm a beginer full stack developer. I need help.</p>
  
  <p>I have the following code:</p>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>@Controller
  public class GreetingController {
  @Autowired
  private MessageRepos messageRepos;
  
  @GetMapping("/")
  public String greeting(Map&lt;String, Object&gt; model) {
      return "greeting";
  }
  
  @GetMapping("/main")
  public String main(Map&lt;String, Object&gt; model) {
      Iterable&lt;Message&gt; messages = messageRepos.findAll();
      model.put("messages", messages);
      return "main";
  }
  
  @PostMapping("/main")
  public String add(@RequestParam String text, @RequestParam String tag, Map&lt;String, Object&gt; model) {
      Message message = new Message(text, tag);
      messageRepos.save(message);
      Iterable&lt;Message&gt; messages = messageRepos.findAll();
      model.put("messages", messages);
      return "main";
  }
  @PostMapping("filter")
  public String filter(@RequestParam String filter, Map&lt;String, Object&gt; model) {
      Iterable&lt;Message&gt; messages;
      if (filter != null &amp;&amp; !filter.isEmpty()) {
          messages = messageRepos.findByTag(filter);
      } else {
          messages = messageRepos.findAll();
      }
      model.put("messages", messages);
      return "main";
  }
  </code></pre>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;/div&gt;
  &lt;div&gt;
      &lt;form method="post"&gt;
          &lt;input type="text" name="text" placeholder="Message" /&gt;
          &lt;input type="text" name="tag" placeholder="Tag"&gt;
          &lt;button type="submit"&gt;Add&lt;/button&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  &lt;div&gt;
      &lt;form method="post" action="filter"&gt;
          &lt;input type="text" name="filter"&gt;
          &lt;button type="submit"&gt;Find&lt;/button&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>When I click on the buttons <strong>add</strong> and <strong>find</strong> I get the problem.</p>
  
  <p><strong>Problem:</strong></p>
  
  <blockquote>
    <p>Request method 'GET' not supported.</p>
  </blockquote>