title: How do I resolve this: The method received in the request-line is known by the origin server but not supported by the target resource
body: <p>I have been trying to make a simple 2 number addition program using servlets and hosting it using tomcat 10.0 server, i was following a tutorial that worked well until this point and I am now unable to solve this, please point out any errors in the code
  web.xml</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;web-app id=&quot;WebApp_ID&quot; version=&quot;2.5&quot; xmlns=&quot;https://JAVA.sun.com/xml/ns/j2ee&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd&quot;&gt;
      &lt;servlet&gt;
      
          &lt;servlet-name&gt;ac&lt;/servlet-name&gt;
          &lt;servlet-class&gt;com.ali.Add&lt;/servlet-class&gt;
      
      &lt;/servlet&gt;
      
      &lt;servlet-mapping&gt;
      
          &lt;servlet-name&gt;ac&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/add&lt;/url-pattern&gt;
          
      &lt;/servlet-mapping&gt;
      
  &lt;/web-app&gt;
  </code></pre>
  <p>Add.java</p>
  <pre><code>package com.ali;
  
  import java.io.IOException;
  import java.io.PrintWriter;
  
  import jakarta.servlet.http.HttpServlet;
  import jakarta.servlet.http.HttpServletRequest;
  import jakarta.servlet.http.HttpServletResponse;
  
  public class Add extends HttpServlet
  {
  public void service(HttpServletResponse res,HttpServletRequest req) throws IOException {
      int i,j,k;
      i=Integer.parseInt(req.getParameter(&quot;n1&quot;));
      j=Integer.parseInt(req.getParameter(&quot;n2&quot;));
      k=i+j;
      PrintWriter out = res.getWriter();
      out.println(&quot;result&quot;+ k);
  }
  }
  </code></pre>
  <p>index.html</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
  
      &lt;form action=&quot;add&quot;&gt;
      
          ne1 : &lt;input type=&quot;number&quot; name=&quot;n1&quot;&gt;&lt;br&gt;
          ne2 : &lt;input type=&quot;number&quot; name=&quot;n2&quot;&gt;&lt;br&gt;
          &lt;input type=&quot;submit&quot;&gt;
          
      &lt;/form&gt;
      
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>Sorry if there's any problems with formatting and grammar, I'm new here...</p>