Java Servlet

We will now see how to implement a login application using Java Servlet. Create a new Dynamic Web Application in Eclipse as described in the previous section. We will call this LoginServletApp:

  1. Right-click on the src folder under Java Resources for the project in Project Explorer. Select the New | Servlet menu option.
  2. In the Create Servlet wizard, enter package name as packt.book.jee_eclipse.book.servlet and class name as LoginServlet. Then, click Finish.
Figure 2.22: Create Servlet wizard
  1. The servlet wizard creates the class for you. Notice the @WebServlet("/LoginServlet") annotation just above the class declaration. Before ...

Get Java EE 8 Development with Eclipse now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.