title: Servlet Is not showing any output
body: <p>I am new to servlets so very simple answer will be much appreciated. My problem is I have written a code of servlet extracting the values from HTML form. But when I run my HTML form like </p>
  
  <blockquote>
    <p><a href="http://localhost:8080/secondTry/form.html" rel="nofollow noreferrer">http://localhost:8080/secondTry/form.html</a></p>
  </blockquote>
  
  <p>html form appears okay. When I enter firstname and lastname, and press the submit button it is not showing any output.. I don't know why..I have searched it on internet but all in vain.
  Moreover, is it has something to do with my tomcat? </p>
  
  <p>Below is my file form.html: </p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;form action="/formServlet" method="get"&gt;
  First name: &lt;input type="text" name="fname"&gt;&lt;br&gt;
  Last name: &lt;input type="text" name="lname"&gt;&lt;br&gt;
  &lt;input type="button" value="submit"&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>secTry.java:</p>
  
  <pre><code>import java.io.*;
  import javax.servlet.*;
  import javax.servlet.http.*;
  public class secTry extends HttpServlet{
      public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException,ServletException{
          String fname = req.getParameter("fname");
          String lname = req.getParameter("lname");
          PrintWriter out = res.getWriter();
          out.println("Hello "+ fname + " " +lname + "...!!!");
      }
  }
  </code></pre>
  
  <p>web.xml file:</p>
  
  <pre><code>&lt;web-app&gt;
    &lt;servlet&gt;
      &lt;servlet-name&gt;secTry&lt;/servlet-name&gt;
      &lt;servlet-class&gt;secTry&lt;/servlet-class&gt;
    &lt;/servlet&gt;
    &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;secTry&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/formServlet&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>PS: I'm compiling my java file on command line using </p>
  
  <blockquote>
    <p>javac -cp .;C:/apache-tomcat-8.5.23/lib/servlet-api.jar secTry.java</p>
  </blockquote>
  
  <p>Please help me and tell me where I am doing wrong?</p>