Let's see a simple example of login and logout in servlet. index.html; FirstServlet.java; LoginDao.java; SecondServlet.java; web.xml. You must need to create a .