Is there a way to create the Servlet (page display - form) and process it using the same Class?
If the browser requests http://mypage.com/TestServlet - then the form input page is displayed, and when the user submits the form, the same servlet action (../TestServlet) is called and it processes the input. I actually put the input processing logic in the doGet() method of the Servlet and now when I make a call to http://mypage.com/TestServlet , the logic is getting invoked automatically with null values. I know I can actually make a JSP or HTML page and then invoke the Servlet from there, but I don't want to. Is there a way to call a particular method of the Servlet? Like calling that method to process the user input when the Submit button is clicked and keeping the doGet() method to display the input form.